The need: Schedule a reccurring job (recdef) to automatically feed in a required date parameter that is always moving. Users want the job to run every monday with the previous monday's date in it.
Anyone ever fool around with the GEN/JOBSTEP table -specifically the PARAMS column in a script?
I'm told that 2201001041 somehow is representative of 010410 or maybe 01042010, but I can't seem to get the pattern.
Anyone have any suggestions/thoughts/comments ? Is there an easier way to do this?
Anything is welcome,
-Greg
I've added code to the COBOL program that says if the parameter date is zero then calculate a date and move it to the parameter date. If the user enters dates on the parameter screen this routine will not override those dates.
In this example I am getting the prior Friday's date and the current Thursday's date
So if I ran it today I would get 20100101 and 20100107:
MOVE ZERO TO WS-NBR-DAYS.
* IF DERIVING PRM-FROM-DATE FROM SYSTEM-DATE, USE THE PREVIOUS * FRIDAY THAT WAY WE ARE PROCESSING THE PRIOR WEEKS DATA. * WSDR-WEEKDAY-NBR; 1 = SUNDAY, 7 = SATURDAY
002500 IF (PRM-FROM-DATE = ZERO) MOVE WS-SYSTEM-DATE-YMD TO WSDR-FR-DATE PERFORM 900-DAY-FROM-DATE COMPUTE WS-NBR-DAYS = WSDR-WEEKDAY-NBR + 2 IF (WS-NBR-DAYS > 6) SUBTRACT 7 FROM WS-NBR-DAYS.
002500 IF (PRM-FROM-DATE = ZERO) MOVE WS-SYSTEM-DATE-YMD TO WSDR-FR-DATE 004900 PERFORM 900-DATE-TO-JULIAN 005000 COMPUTE WSDR-JULIAN-DAYS = WSDR-JULIAN-DAYS - WS-NBR-DAYS 005100 PERFORM 900-JULIAN-TO-DATE 005200 MOVE WSDR-FR-DATE TO PRM-TO-DATE 005000 COMPUTE WSDR-JULIAN-DAYS = WSDR-JULIAN-DAYS - 6 005100 PERFORM 900-JULIAN-TO-DATE 005200 MOVE WSDR-FR-DATE TO PRM-FROM-DATE. 005000 DISPLAY "PRM-FROM-DATE = " PRM-FROM-DATE. 005000 DISPLAY "PRM-TO-DATE = " PRM-TO-DATE.
.