To run periodic reports, which process the same type of data except for a different time period each month, quarter, etc (e.g. the current accounting period), set up a comment line in a LF DDS ($$DATE line) which contains parameters for the proper date insertion on the FOLLOWING line. The following line contains the appropriate select/omit criteria. The batch CL program, which runs the report, overrides a generic utility filename to the pertinent DDS member and executes a utility to scrutinize the DDS for date insertion. Report batch jobs are routinely submitted using a "report menu" program, which generically submits a job comprised of a CALL and 2 dates ("from" and "to" dates). The utility read the overridden generic file. It expects an "F" or "T" as the first parameter and a length as the second parameter (6 to accommodate such data items as accounting period and 8 for calendar dates). It then formats the proper passed date and updates the DDS record with the proper value. For flexibility, the first parameter can also specify a relative date such as "T-3" which is interpreted as "to date - 3 months. The application report program then processes the same LF, which consists of only those records for the current execution. It also can insert the dates, which are passed as parameters into the report heading.
PGM PARM(&FROMDATE &TODATE) OVRDBF FILE(QDDSSRC) TOFILE (APPLIB/QDDSSRC) MBR(INVOICELF1) CALL DDSUTILITY PARM(&FROMDATE &TODATE) DLTOVR QDDSSRC CALL APPPGM PARM(&FROMDATE &TODATE) ----------------------------------- A*$$DATE(F,6) A O ACTDTE COMP(LT 200101) A*$$DATE(T,6) A O ACTDTE COMP(GT 200101) -------------------------------------- A*$$DATE(T-3,8) A O CALDATE COMP(LT 20010101) A*$$DATE(T,8) A O CALDATE COMP(GT 20010330)
This was first published in June 2001