Typical DCL Command Procedure to set up the program (1) :

$! 
$!	BO-SUBCODE-SEL.COM
$! 
$!      Description:    Lists and totals transactions on selected subcodes. 
$! 
$ SET NOVERIFY 
$ SAY :== "WRITE SYS$OUTPUT" 
$ DELETE/LOG SYS$LOGIN:FOCTEMP.COM;*
$ CL
$! 
$ SAY "This will create the subcode selection report" 
$ SAY "for the specified term, date range, and subcode."  
$ SAY " "
$ SAY "(BO-SUBCODE-SEL)" 
$ SAY " "
$! 
$!  Prompt for term 
$!
$ENTER_PARM_TERM: 
$ READ SYS$COMMAND/TIME=60/END=EXIT/ERROR=EXIT/PROMPT= -   
  "Enter the five digit term to run this list for (CCYYX) >>> " TERMIN   
$ LEN_TERMIN = F$LENGTH(TERMIN) 
$ IF LEN_TERMIN .NE. 5 THEN GOTO ENTER_PARM_TERM 
$ TYP_TERMIN = F$TYPE(TERMIN) 
$ IF TYP_TERMIN .NES. "INTEGER" THEN GOTO ENTER_PARM_TERM
$! 
$!  Prompt for beginning date 
$!
$ENTER_PARM_BDAY: 
$ READ SYS$COMMAND/TIME=60/END=EXIT/ERROR=EXIT/PROMPT= -   
  "Enter the beginning date (YYYYMMDD) to run this list for >>> " BDAYIN   
$ LEN_BDAYIN = F$LENGTH(BDAYIN) 
$ IF LEN_BDAYIN .NE. 8 THEN GOTO ENTER_PARM_BDAY 
$ TYP_BDAYIN = F$TYPE(BDAYIN) 
$ IF TYP_BDAYIN .NES. "INTEGER" THEN GOTO ENTER_PARM_BDAY
$! 
$!  Prompt for ending date 
$!
$ENTER_PARM_EDAY: 
$ READ SYS$COMMAND/TIME=60/END=EXIT/ERROR=EXIT/PROMPT= -   
  "Enter the ending date (YYYYMMDD) to run this list for >>> " EDAYIN   
$ LEN_EDAYIN = F$LENGTH(EDAYIN) 
$ IF LEN_EDAYIN .NE. 8 THEN GOTO ENTER_PARM_EDAY 
$ TYP_EDAYIN = F$TYPE(EDAYIN) 
$ IF TYP_EDAYIN .NES. "INTEGER" THEN GOTO ENTER_PARM_EDAY
$! 
$!  Create subcode file 
$! 
$ OPEN/WRITE output_file SYS$LOGIN:SUB.TXT 
$! 
$!  Prompt for subcode 
$!
$ENTER_INSUB: 
$ READ SYS$COMMAND/TIME=60/END=EXIT_INSUB/ERROR=EXIT_INSUB/PROMPT= -   
  "Enter the subcode to run this list for >>> " INSUB   
$ LEN_INSUB = F$LENGTH(INSUB) 
$ IF LEN_INSUB .NE. 5 THEN GOTO ENTER_INSUB 
$ TYP_INSUB = F$TYPE(INSUB) 
$ IF TYP_INSUB .NES. "INTEGER" THEN GOTO ENTER_INSUB
$ WRITE output_file INSUB 
$!
$ READ SYS$COMMAND/TIME=60/END=EXIT_INSUB/ERROR=EXIT_INSUB/PROMPT= -   
  "Enter more subcodes? [Y,N ... default is Y] >>> " MOSUB   
$ IF (MOSUB .EQS. "Y") .OR (MOSUB .EQS. "") THEN GOTO ENTER_INSUB 
$ GOTO CREATE_JOB
$!
$EXIT_INSUB:
$ CLOSE output_file 
$ EXIT
$!
$!  Create and execute the FOCUS command procedure.
$!
$CREATE_JOB:
$ CLOSE output_file 
$ NAME = F$GETJPI("","USERNAME")
$ COM_FILE = "SYS$LOGIN:FOCTEMP.COM"
$!
$ OPEN/WRITE output_file 'COM_FILE' 
$! 
$ WRITE output_file "$ DEFINE FOC$DIR1 SI$DATA" 
$ WRITE output_file "$ DEFINE FOC$DIR2 SI$FEX,SI$MFD" 
$ WRITE output_file "$ SET DEFAULT SYS$LOGIN" 
$ WRITE output_file "$ FOCUS" 
$ output_record = "EXEC SI$FOCUS:BO-SUBCODE-SEL TERM_IN=" + TERMIN + -
                  ",BEGDT=" + BDAYIN + ",ENDDT=" + EDAYIN  
$ WRITE output_file output_record 
$ WRITE output_file "FIN" 
$ WRITE output_file "$ COPY SYS$LOGIN:REPORT.WP SYS$LOGIN:REPORT.DOC;" 
$ output_record = "$ MAIL/SUBJECT=" + """BO-SUBCODE-SEL""" + -
                  SYS$LOGIN:REPORT.DOC " + "''NAME'" 
$ WRITE output_file output_record 
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:*.FTM;*"
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:*.MAS;*"
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:*.WP;*"
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:SUB.TXT;*"
$ WRITE output_file "$ EXIT" 
$! 
$ CLOSE output_file 
$ SUBMIT/NOPRINT/NOTIFY/QUEUE=SYS$BATCH 'COM_FILE'
$!
$EXIT:
$!
$ SAY " " 
$ SAY "All done..." 
$ SAY " " 
$ SAY "You will receive notification once report is completed..." 
$ SAY " " 
$!
$ SET DEFAULT SYS$LOGIN
$ EXIT


FOCUS program (1) :

-*BEGIN DOC - BO-SUBCODE-SEL
-*
-*FEX: 
-*
-*INPUT
-*      TERM_IN : Enrollment Term
-*      SUB     : Subcode List
-*      BEGDT   : Beginning Date
-*      ENDDT   : Ending Date
-*
-*      This FOCUS request lists the accounts that have posted
-*	transactions to the input subcodes.
-*
-*END DOC
-*
SET PAGE=OFF
FILEDEF SUB DISK SYS$LOGIN:SUB.TXT
JOIN CLEAR *
-*
-*  Select transactions that meet the criteria.
-*
TABLE FILE BDFILE
PRINT SUBCODE TRAN_DT TRAN_AMT BY STU_ID
IF SUBCODE IS (SUB) 
IF TERM EQ '&TERM_IN'
IF TRAN_DT IS-FROM &BEGDT TO &ENDDT
ON TABLE HOLD AS BDTEMP1
END
-*
-*  Produce the output report.
-*
JOIN STU_ID IN BDTEMP1 TO KEY IN AAFILE AS J1
DEFINE FILE BDTEMP1
BMDY/A10 = EDIT(TRAN_DT, '$$$$99$$')|'/'|EDIT(TRAN_DT, '$$$$$$99')
|'/'|EDIT(TRAN_DT, '9999$$$$');
END
TABLE FILE BDTEMP1
HEADING
"BO-SUBCODE-SEL         BILLING SUBCODE SELECTION REPORT      Page: <TABPAGENO"
"                                                             Date: &DATE"
"         Date Range: &BEGDT -> &ENDDT         Term: &TERM_IN"
" "
PRINT BMDY AS 'Date' TRAN_AMT AS 'Amount'
ON TABLE HOLD AS REPORT FORMAT WP
BY SUBCODE AS 'Subcode' IN 1
BY STU_NAME 
BY STU_ID AS 'SSN'
ON SUBCODE SUBTOTAL
END 
JOIN CLEAR *


Typical DCL Command Procedure to set up the program (2) :

$! 
$!	BO-SUBCODE-STU-SEL.COM
$! 
$!      Description:    Lists and totals transactions on selected subcodes. 
$!                      Report sorts by students and totals input subcodes
$!                      at the end.
$! 
$ SET NOVERIFY 
$ SAY :== "WRITE SYS$OUTPUT" 
$ DELETE/LOG SYS$LOGIN:FOCTEMP.COM;*
$ CL
$! 
$ SAY "This will create the subcode selection report" 
$ SAY "for the specified term, date range, and subcode."  
$ SAY " "
$ SAY "Report sorts by students and totals input subcodes"
$ SAY "at the end."
$ SAY " "
$ SAY "(BO-SUBCODE-STU-SEL)" 
$ SAY " "
$! 
$!  Prompt for beginning date 
$!
$ENTER_PARM_BDAY: 
$ READ SYS$COMMAND/TIME=60/END=EXIT/ERROR=EXIT/PROMPT= -   
  "Enter the beginning date (YYYYMMDD) to run this list for >>> " BDAYIN   
$ LEN_BDAYIN = F$LENGTH(BDAYIN) 
$ IF LEN_BDAYIN .NE. 8 THEN GOTO ENTER_PARM_BDAY 
$ TYP_BDAYIN = F$TYPE(BDAYIN) 
$ IF TYP_BDAYIN .NES. "INTEGER" THEN GOTO ENTER_PARM_BDAY
$! 
$!  Prompt for ending date 
$!
$ENTER_PARM_EDAY: 
$ READ SYS$COMMAND/TIME=60/END=EXIT/ERROR=EXIT/PROMPT= -   
  "Enter the ending date (YYYYMMDD) to run this list for >>> " EDAYIN   
$ LEN_EDAYIN = F$LENGTH(EDAYIN) 
$ IF LEN_EDAYIN .NE. 8 THEN GOTO ENTER_PARM_EDAY 
$ TYP_EDAYIN = F$TYPE(EDAYIN) 
$ IF TYP_EDAYIN .NES. "INTEGER" THEN GOTO ENTER_PARM_EDAY
$! 
$!  Create subcode file 
$! 
$ OPEN/WRITE output_file SYS$LOGIN:SUB.TXT 
$! 
$!  Prompt for subcode 
$!
$ENTER_INSUB: 
$ READ SYS$COMMAND/TIME=60/END=EXIT_INSUB/ERROR=EXIT_INSUB/PROMPT= -   
  "Enter the subcode to run this list for >>> " INSUB   
$ LEN_INSUB = F$LENGTH(INSUB) 
$ IF LEN_INSUB .NE. 5 THEN GOTO ENTER_INSUB 
$ TYP_INSUB = F$TYPE(INSUB) 
$ IF TYP_INSUB .NES. "INTEGER" THEN GOTO ENTER_INSUB
$ WRITE output_file INSUB 
$!
$ READ SYS$COMMAND/TIME=60/END=EXIT_INSUB/ERROR=EXIT_INSUB/PROMPT= -   
  "Enter more subcodes? [Y,N ... default is Y] >>> " MOSUB   
$ IF (MOSUB .EQS. "Y") .OR (MOSUB .EQS. "") THEN GOTO ENTER_INSUB 
$ GOTO CREATE_JOB
$!
$EXIT_INSUB:
$ CLOSE output_file 
$ EXIT
$!
$!  Create and execute the FOCUS command procedure.
$!
$CREATE_JOB:
$ CLOSE output_file 
$ NAME = F$GETJPI("","USERNAME")
$ COM_FILE = "SYS$LOGIN:FOCTEMP.COM"
$!
$ OPEN/WRITE output_file 'COM_FILE' 
$! 
$ WRITE output_file "$ DEFINE FOC$DIR1 SI$DATA" 
$ WRITE output_file "$ DEFINE FOC$DIR2 SI$FEX,SI$MFD" 
$ WRITE output_file "$ SET DEFAULT SYS$LOGIN" 
$ WRITE output_file "$ FOCUS" 
$ output_record = "EXEC SI$FOCUS:BO-SUBCODE-STU-SEL BEGDT=" + -
                  BDAYIN + ",ENDDT=" + EDAYIN  
$ WRITE output_file output_record 
$ WRITE output_file "FIN" 
$ WRITE output_file "$ COPY SYS$LOGIN:REPORT.WP SYS$LOGIN:REPORT.DOC;" 
$ output_record = "$ MAIL/SUBJECT=" + """BO-SUBCODE-STU-SEL""" + -
                  SYS$LOGIN:REPORT.DOC " + "''NAME'" 
$ WRITE output_file output_record 
$ WRITE output_file "$ COPY SYS$LOGIN:REPORT2.WP SYS$LOGIN:REPORT2.DOC" 
$ output_record = "$ MAIL/SUBJECT=" + """BO-SUBCODE-STU-SEL""" + -
                  SYS$LOGIN:REPORT.DOC " + "''NAME'" 
$ WRITE output_file output_record 
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:*.FTM;*"
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:*.MAS;*"
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:*.WP;*"
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:SUB.TXT;*"
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:REPORT2.DOC;*"
$ WRITE output_file "$ EXIT" 
$! 
$ CLOSE output_file 
$ SUBMIT/NOPRINT/NOTIFY/QUEUE=SYS$BATCH 'COM_FILE'
$!
$EXIT:
$!
$ SAY " " 
$ SAY "All done..." 
$ SAY " " 
$ SAY "You will receive notification once report is completed..." 
$ SAY " " 
$!
$ SET DEFAULT SYS$LOGIN
$ EXIT


FOCUS program (2) :

-*BEGIN DOC - BO-SUBCODE-STU-SEL
-*
-*FEX: 
-*
-*INPUT
-*      SUB     : Subcode List
-*      BEGDT   : Beginning Date
-*      ENDDT   : Ending Date
-*
-*      This FOCUS request lists the accounts that have posted
-*	transactions to the input subcodes. This list is sorted
-*      by students with a total for each input subcode at the end.
-*
-*END DOC
-*
SET PAGE=OFF
FILEDEF SUB DISK SYS$LOGIN:SUB.TXT
JOIN CLEAR *
-*
-*  Select transactions that meet the criteria.
-*
TABLE FILE BDFILE
PRINT SUBCODE TRAN_DT TRAN_AMT BY STU_ID
IF SUBCODE IS (SUB) 
IF TRAN_DT IS-FROM &BEGDT TO &ENDDT
ON TABLE HOLD AS BDTEMP1
END
-*
-*  Produce the subcode totals.
-*
TABLE FILE BDTEMP1
HEADING
"SUBCODE TOTALS "
" "
SUM TRAN_AMT AS '' BY SUBCODE AS ''
ON TABLE SAVE AS REPORT2 FORMAT WP
END
-*
-*  Produce the output report.
-*
JOIN STU_ID IN BDTEMP1 TO KEY IN AAFILE AS J1
DEFINE FILE BDTEMP1
BMDY/A10 = EDIT(TRAN_DT, '$$$$99$$')|'/'|EDIT(TRAN_DT, '$$$$$$99')
|'/'|EDIT(TRAN_DT, '9999$$$$');
END
TABLE FILE BDTEMP1
HEADING
"BO-SUBCODE-SEL         BILLING SUBCODE SELECTION REPORT      Page: <TABPAGENO"
"                                                             Date: &DATE"
"         Date Range: &BEGDT -> &ENDDT"
" "
PRINT BMDY AS 'Date' IN 52 TRAN_AMT AS 'Amount' IN 65
ON TABLE SAVE AS REPORT FORMAT WP
BY STU_NAME IN 12
BY STU_ID AS 'SSN' IN 1
BY SUBCODE AS 'Subcode' IN 43
ON STU_NAME SUBTOTAL AS 'Total For '
END 
JOIN CLEAR *


Typical DCL Command Procedure to set up the program (3) :

$! 
$!	BO-SUBCODE-TOT.COM
$! 
$!      Description:    Totals transactions on selected subcodes. 
$! 
$ SET NOVERIFY 
$ SAY :== "WRITE SYS$OUTPUT" 
$ DELETE/LOG SYS$LOGIN:FOCTEMP.COM;*
$ CL
$! 
$ SAY "This will create the subcode totals report" 
$ SAY "for the specified term, date range, and subcode."  
$ SAY " "
$ SAY "(BO-SUBCODE-TOT)" 
$ SAY " "
$! 
$!  Prompt for term 
$!
$ENTER_PARM_TERM: 
$ READ SYS$COMMAND/TIME=60/END=EXIT/ERROR=EXIT/PROMPT= -   
  "Enter the five digit term to run this list for (CCYYX) >>> " TERMIN   
$ LEN_TERMIN = F$LENGTH(TERMIN) 
$ IF LEN_TERMIN .NE. 5 THEN GOTO ENTER_PARM_TERM 
$ TYP_TERMIN = F$TYPE(TERMIN) 
$ IF TYP_TERMIN .NES. "INTEGER" THEN GOTO ENTER_PARM_TERM
$! 
$!  Prompt for beginning date 
$!
$ENTER_PARM_BDAY: 
$ READ SYS$COMMAND/TIME=60/END=EXIT/ERROR=EXIT/PROMPT= -   
  "Enter the beginning date (YYYYMMDD) to run this list for >>> " BDAYIN   
$ LEN_BDAYIN = F$LENGTH(BDAYIN) 
$ IF LEN_BDAYIN .NE. 8 THEN GOTO ENTER_PARM_BDAY 
$ TYP_BDAYIN = F$TYPE(BDAYIN) 
$ IF TYP_BDAYIN .NES. "INTEGER" THEN GOTO ENTER_PARM_BDAY
$! 
$!  Prompt for ending date 
$!
$ENTER_PARM_EDAY: 
$ READ SYS$COMMAND/TIME=60/END=EXIT/ERROR=EXIT/PROMPT= -   
  "Enter the ending date (YYYYMMDD) to run this list for >>> " EDAYIN   
$ LEN_EDAYIN = F$LENGTH(EDAYIN) 
$ IF LEN_EDAYIN .NE. 8 THEN GOTO ENTER_PARM_EDAY 
$ TYP_EDAYIN = F$TYPE(EDAYIN) 
$ IF TYP_EDAYIN .NES. "INTEGER" THEN GOTO ENTER_PARM_EDAY
$! 
$!  Create subcode file 
$! 
$ OPEN/WRITE output_file SYS$LOGIN:SUB.TXT 
$! 
$!  Prompt for subcode 
$!
$ENTER_INSUB: 
$ READ SYS$COMMAND/TIME=60/END=EXIT_INSUB/ERROR=EXIT_INSUB/PROMPT= -   
  "Enter the subcode to run this list for >>> " INSUB   
$ LEN_INSUB = F$LENGTH(INSUB) 
$ IF LEN_INSUB .NE. 5 THEN GOTO ENTER_INSUB 
$ TYP_INSUB = F$TYPE(INSUB) 
$ IF TYP_INSUB .NES. "INTEGER" THEN GOTO ENTER_INSUB
$ WRITE output_file INSUB 
$!
$ READ SYS$COMMAND/TIME=60/END=EXIT_INSUB/ERROR=EXIT_INSUB/PROMPT= -   
  "Enter more subcodes? [Y,N ... default is Y] >>> " MOSUB   
$ IF (MOSUB .EQS. "Y") .OR (MOSUB .EQS. "") THEN GOTO ENTER_INSUB 
$ GOTO CREATE_JOB
$!
$EXIT_INSUB:
$ CLOSE output_file 
$ EXIT
$!
$!  Create and execute the FOCUS command procedure.
$!
$CREATE_JOB:
$ CLOSE output_file 
$ NAME = F$GETJPI("","USERNAME")
$ COM_FILE = "SYS$LOGIN:FOCTEMP.COM"
$!
$ OPEN/WRITE output_file 'COM_FILE' 
$! 
$ WRITE output_file "$ DEFINE FOC$DIR1 SI$DATA" 
$ WRITE output_file "$ DEFINE FOC$DIR2 SI$FEX,SI$MFD" 
$ WRITE output_file "$ SET DEFAULT SYS$LOGIN" 
$ WRITE output_file "$ FOCUS" 
$ output_record = "EXEC SI$FOCUS:BO-SUBCODE-TOT TERM_IN=" + TERMIN + -
                  ",BEGDT=" + BDAYIN + ",ENDDT=" + EDAYIN  
$ WRITE output_file output_record 
$ WRITE output_file "FIN" 
$ WRITE output_file "$ COPY SYS$LOGIN:REPORT.WP SYS$LOGIN:REPORT.DOC;" 
$ output_record = "$ MAIL/SUBJECT=" + """BO-SUBCODE-TOT""" + -
                  SYS$LOGIN:REPORT.DOC " + "''NAME'" 
$ WRITE output_file output_record 
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:*.FTM;*"
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:*.MAS;*"
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:*.WP;*"
$ WRITE output_file "$ DELETE/LOG SYS$LOGIN:SUB.TXT;*"
$ WRITE output_file "$ EXIT" 
$! 
$ CLOSE output_file 
$ SUBMIT/NOPRINT/NOTIFY/QUEUE=SYS$BATCH 'COM_FILE'
$!
$EXIT:
$!
$ SAY " " 
$ SAY "All done..." 
$ SAY " " 
$ SAY "You will receive notification once report is completed..." 
$ SAY " " 
$!
$ SET DEFAULT SYS$LOGIN
$ EXIT


FOCUS program (3) :

-*BEGIN DOC - BO-SUBCODE-TOT
-*
-*FEX: 
-*
-*INPUT
-*      TERM_IN : Enrollment Term
-*      SUB     : Subcode List
-*      BEGDT   : Beginning Date
-*      ENDDT   : Ending Date
-*
-*      This FOCUS request lists the totals of the input subcodes that have 
-*      posted transactions on them.
-*
-*END DOC
-*
SET PAGE=OFF
FILEDEF SUB DISK SYS$LOGIN:SUB.TXT
JOIN CLEAR *
-*
-*  Select transactions that meet the criteria.
-*
TABLE FILE BDFILE
PRINT SUBCODE TRAN_DT TRAN_AMT BY STU_ID
IF SUBCODE IS (SUB) 
IF TERM EQ '&TERM_IN'
IF TRAN_DT IS-FROM &BEGDT TO &ENDDT
ON TABLE HOLD AS BDTEMP1
END
-*
-*  Produce the output report.
-*
TABLE FILE BDTEMP1
HEADING
"BO-SUBCODE-TOT         BILLING SUBCODE TOTALS REPORT         Page: <TABPAGENO"
"                                                             Date: &DATE"
"         Date Range: &BEGDT -> &ENDDT         Term: &TERM_IN"
" "
SUM TRAN_AMT AS 'Amount'
ON TABLE HOLD AS REPORT FORMAT WP
BY SUBCODE AS 'Subcode' IN 1
ON SUBCODE SUBTOTAL
END 
JOIN CLEAR *

 

 

This page hosted by Get your own Free Homepage

Hosted by www.Geocities.ws

1