Currently we populate the current julian date to the header with the below code
OPTION COPY
OUTFIL REMOVECC,
HEADER1=('H',X,YDDDNS=(4D))
The job A ran on Jan 11th 2012
Current header record of output file:
H 2012011
New requirement:
--------------------
The output file header record should be written with current month 15th julian date irrespective of the current date of job execution.
For example :
Scenario -1
If my job A runs on Jan 20th 2012, then the output file header should have Jan 15th 2012 julian date (2012015)
Scenario -2
If my job A runs on Feb 8th 2012, then the output file header should have Feb 15th 2012 julian date (2012046)
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
A solution, using the generation of a SYMNAME for the modified date, thus requiring one extra step, but not reading any particular data.
I couldn't get the system date in, day changed to 15 and the date conversion done in one OVERLAY or BUILD within a reasonable amount of time. Doesn't mean it can't be done...
//SYSOUT DD SYSOUT=*
//SORTOUT DD DSN=&&SYM,SPACE=(TRK,1),DISP=(,PASS),UNIT=SYSDA
//SORTIN DD *
The sortin for this step could be any dataset you like, as long as it is F and has
at least one record. If it has more than one, the STOPAFT=1 will stop it causing problems
//HEADADD EXEC PGM=SORT
//SYMNAMES DD DSN=&&SYM,DISP=(OLD,PASS)
//SYMNOUNT DD SYSOUT=*
//SYSIN DD *
I have tested it with other dates up to June this year.
Edit: Maybe the code does not use the IFTHENs: they were part of an "attempt" and they stayed for setting the output record-length to 80. Maybe instead an appropriate number of Xs could be used to get the length.