Page 1 of 1

sort card for gaetting date in yymm format

PostPosted: Thu Feb 21, 2013 5:00 pm
by cbhargavi
Hi,
can any body knows how to get a current month date using sort card in jcl..format should be yymm..

Re: sort card for gaetting date in yymm format

PostPosted: Thu Feb 21, 2013 6:51 pm
by Robert Sample
Do you use CA-SORT, SYNCSORT, DFSORT, or some other sort package? What have you tried so far and what problems have you experienced? What manual(s) have you used for your research to date?

Re: sort card for gaetting date in yymm format

PostPosted: Thu Feb 21, 2013 11:14 pm
by cbhargavi
I used DFSORT and i searched for different date formats but still didnt find anything for yymm format..is there any possibility to use substring of dates...
i tried for DATE,DATE1,DATE2 etc.,

Re: sort card for gaetting date in yymm format

PostPosted: Fri Feb 22, 2013 5:13 am
by skolusu
cbhargavi ,

Assuming you want date in position 30 in a RECFM=FB and LRECL=80 byte , use the following DFSORT JCL. If your input is VB we may need to do it differently.

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
----+----1----+----2----+----3----+----4----+----5----+----6----+
WANT YYMM IN POSITION 30
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  INREC IFOUTLEN=80,
        IFTHEN=(WHEN=INIT,OVERLAY=(81:DATE2,30:83,4))
//*


The output of the above job is
----+----1----+----2----+----3----+
WANT YYMM IN POSITION 30     1302