create or replace procedure student_class_list (p_s_id IN enrollments.stu_id%TYPE) 
as
CURSOR s_class_cur IS
SELECT enrollment_date, class_id, status
FROM enrollments
WHERE stu_id=p_s_id
AND enrollment_date BETWEEN ADD_MONTHS(sysdate,-72) AND SYSDATE;
BEGIN
DBMS_OUTPUT.PUT_LINE ('STUDENT '||p_s_id||' is enrolled in the following classes within the most recent 6 years:' );
FOR s_class_rec IN s_class_cur 
LOOP
DBMS_OUTPUT.PUT_LINE(' On: '||s_class_rec.enrollment_date||' the student enrolled the class with the id:'||s_class_rec.class_id||' and with status '||s_class_rec.status);
END LOOP;
END;