FOCUS program :

-*BEGIN DOC
-*
-*FEX: GE-UNDUP-DAY-EVE-BOTH	
-*
-*INPUT
-*	TERM_IN
-*	
-*	This FOCUS request produces three reports :
-*
-*	1) Gives an unduplicated count of students who only took
-*         evening classes for a given term.
-*
-*	2) Gives an unduplicated count of students who only took
-*         day classes for a given term.
-*
-*	3) Gives an unduplicated count of students who only took
-*         both day and evening classes for a given term.
-*
-*END DOC
-*
-PROMPT &TERM_IN/A5.ENTER THE FIVE DIGIT TERM FOR REPORT (CCYYX) :
SET LINES=999999
SET PAGE=NOPAGE
JOIN CLEAR *
-*
-*  Select all students who have taken at least one
-*  evening course.
-*
DEFINE FILE RTFILE
EVE_SEC/A2=EDIT(SECTION_ID,'$$$$$$$99$$');
END
-*
TABLE FILE RTFILE
PRINT CURR_ATTEMPTED_HRS BY STU_ID
ON TABLE HOLD AS RTTEMP1

(Selection criteria for evening courses)

IF COLLEGE_SPE NE 'CE'
WHERE CURR_ATTEMPTED_HRS GT 0;
WHERE TERM EQ '&TERM_IN';
END
-*
-*  Remove all duplicate records.
-*
DEFINE FILE RTTEMP1
THS_REC/A1=IF STU_ID NE LAST STU_ID THEN 'Y' ELSE 'N';
END
-*
TABLE FILE RTTEMP1
PRINT CURR_ATTEMPTED_HRS BY STU_ID
ON TABLE HOLD AS RTTEMP2
WHERE THS_REC EQ 'Y';
END
-*
-*  Select all students who have taken at least one
-*  day course.
-*
DEFINE FILE RTFILE
EVE_SEC/A2=EDIT(SECTION_ID,'$$$$$$$99$$');
END
-*
TABLE FILE RTFILE
PRINT CURR_ATTEMPTED_HRS BY STU_ID
ON TABLE HOLD AS RTTEMP3

(Selection criteria for day courses)

IF COLLEGE_SPE NE 'CE'
WHERE CURR_ATTEMPTED_HRS GT 0;
WHERE TERM EQ '&TERM_IN';
END
-*
-*  Remove all duplicate records.
-*
DEFINE FILE RTTEMP3
THS_REC/A1=IF STU_ID NE LAST STU_ID THEN 'Y' ELSE 'N';
END
-*
TABLE FILE RTTEMP3
PRINT CURR_ATTEMPTED_HRS BY STU_ID
ON TABLE HOLD AS RTTEMP4
WHERE THS_REC EQ 'Y';
END
-*
-*  Match two hold files to select students who have only taken
-*  evening courses.
-*
MATCH FILE RTTEMP2
PRINT CURR_ATTEMPTED_HRS BY STU_ID
RUN
FILE RTTEMP4
PRINT CURR_ATTEMPTED_HRS BY STU_ID
AFTER MATCH HOLD OLD-NOT-NEW
END
-RUN
-*
-*  List out the total number.
-*
TABLE FILE HOLD
-*
HEADING 
"DATE: &DATE  TIME: &TOD  Report Name: GE-UNDUP-DAY-EVE-BOTH"
"Term: &TERM_IN"
" "
"Students who only took evening classes"
" "
-*
SUM CNT.STU_ID AS 'Total Student,    Count'
ON TABLE HOLD AS REPORT1 FORMAT WP
END
-*
-*
-*  Match two hold files to select students who have only taken
-*  day courses.
-*
MATCH FILE RTTEMP2
PRINT CURR_ATTEMPTED_HRS BY STU_ID
RUN
FILE RTTEMP4
PRINT CURR_ATTEMPTED_HRS BY STU_ID
AFTER MATCH HOLD NEW-NOT-OLD
END
-RUN
-*
-*  List out the total number.
-*
FILEDEF REPORT DISK REPORT.WP APPEND
TABLE FILE HOLD
-*
HEADING 
" "
" "
"Students who only took day classes"
" "
-*
SUM CNT.STU_ID AS 'Total Student,    Count'
ON TABLE HOLD AS REPORT2 FORMAT WP
END
-*
-*  Match two hold files to select students who have taken
-*  both day and evening courses.
-*
MATCH FILE RTTEMP2
PRINT CURR_ATTEMPTED_HRS BY STU_ID
RUN
FILE RTTEMP4
PRINT CURR_ATTEMPTED_HRS BY STU_ID
AFTER MATCH HOLD OLD-AND-NEW
END
-RUN
-*
-*  List out the total number.
-*
FILEDEF REPORT DISK REPORT.WP APPEND
TABLE FILE HOLD
-*
HEADING 
" "
" "
"Students who took both day and evening classes"
" "
-*
SUM CNT.STU_ID AS 'Total Student,    Count'
ON TABLE HOLD AS REPORT3 FORMAT WP
END
-RUN
-VMS COPY REPORT1.WP,REPORT2.WP,REPORT3.WP  REPORT.WP
JOIN CLEAR *

 

 

This page hosted by Get your own Free Homepage

Hosted by www.Geocities.ws

1