Joined: 27 Mar 2009 Posts: 13 Location: London, UK
Hi everyone,
Does anybody know how I can get a symbolic variable into an SORTs output file please?
In my JCL I have a symbolic variable set as...
Code:
DATE='01.07.2009'
...and then some JCL creating a report as shown below. I am hoping to find a way to insert the DATE value above into TRAILER1 where it says 'Date value here'. Can anybody point me the right way please? (I've removed the extra bits from the jcl for readability)
Joined: 27 Mar 2009 Posts: 13 Location: London, UK
Hi Skolusu.
Thankyou for your reply. I've had a read of your link and it looks like exactly the thing I need. I will give it a go today and post my results.
In answer to your question I will be using an offset of the current date, but this has the potential to change on a whim so having the ability to pass in a variable may be better than hard coding a 'give me today +1' into the sort. That said, it's a good fall back option if I can't get the other method to work.
Joined: 27 Mar 2009 Posts: 13 Location: London, UK
I have spent some time trying out your suggestions Skolusu with mixed results.
The link you provided is superd and I have managed to find another use for it, unfortunately I have misunderstood how I am using the symbolic variables we have set up in my existing problem... on to plan B.
I have attempted to find out how to incorporate a date into the output as per your second suggestion but am running into difficulties understanding the examples in the documentation we have.
If I am using the below SYSIN to format the output, how can I insert a DATE1(.)+1 date value into the header only at position 50 please? I have tried various combinations and none seem to be hitting the mark.
Code:
SORT FIELDS=(63,4,CH,A,60,2,CH,A,57,2,CH,A,1,9,CH,A,47,9,CH,A),
SKIPREC=1
SUM FIELDS=NONE
OUTFIL FNAMES=REPOUT, REMOVECC
OUTREC=(1:1,9,15:57,10,28:47,9,40:11,35),
HEADER2=(1:'PMSMD28 ',
22:'REPORT TITLE IS HERE ',
50:&DATE1(.)+1,60:' ',/,
1:'COLUMN ONE ',15:'COLUMN TWO',28:'COLUMN THR',
40:'COLUMN NUMBER FOUR ',/,
1:'------------',15:'----------',28:'----------',
40:'------------------------------'),
TRAILER1=(1:'END OF REPORT'),
TRAILER2=(1:' '),
OPTION SKIPREC=1
SORT FIELDS=(63,4,CH,A,60,2,CH,A,57,2,CH,A,1,9,CH,A,47,9,CH,A)
SUM FIELDS=NONE
OUTFIL FNAMES=REPOUT,REMOVECC,
OUTREC=(1:1,9,15:57,10,28:47,9,40:11,35),
HEADER2=(01:'PMSMD28 ',
22:'REPORT TITLE IS HERE ',
50:SYM1,60:' ',/,
01:'COLUMN ONE ',15:'COLUMN TWO',28:'COLUMN THR',
40:'COLUMN NUMBER FOUR ',/,
01:'------------',15:'----------',28:'----------',
40:'------------------------------'),
TRAILER2=(1:' '),
TRAILER1=(1:'END OF REPORT')
If you want the current date +/- offset then use the following control cards. This will put the current date + 1 day in CCYY.MM.DD format on the header.
Code:
//SYSIN DD *
OPTION SKIPREC=1
SORT FIELDS=(63,4,CH,A,60,2,CH,A,57,2,CH,A,1,9,CH,A,47,9,CH,A)
SUM FIELDS=NONE
OUTREC BUILD=(1:1,9,15:57,10,28:47,9,40:11,35,DATE1(.)+1)
OUTFIL FNAMES=REPOUT,REMOVECC,BUILD=(1,74),
HEADER2=(01:'PMSMD28 ',
22:'REPORT TITLE IS HERE ',
50:75,10,60:' ',/,
01:'COLUMN ONE ',15:'COLUMN TWO',28:'COLUMN THR',
40:'COLUMN NUMBER FOUR ',/,
01:'------------',15:'----------',28:'----------',
40:'------------------------------'),
TRAILER2=(1:' '),
TRAILER1=(1:'END OF REPORT')