converting date yyyy-mm-dd to yymmdd to set the date in jcl



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

converting date yyyy-mm-dd to yymmdd to set the date in jcl

Postby Venkichaitu » Mon Jun 03, 2013 6:49 pm

I have one file which has 3 records and has date format yyyy-mm-dd(starting from 1st position) format i have to convert this date to yymmdd and the i need to write the output first record as //SET SET DATE =DYYMMDD , second record as //SET SET DATE1=DYYMMDD and third record as //SET SET DATE2=YYMMDD .Could you please let me know how to write all these 3 records in one file .

Regards
Venkat
Venkichaitu
 
Posts: 1
Joined: Tue May 28, 2013 3:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: converting date yyyy-mm-dd to yymmdd to set the date in

Postby bodatrinadh » Mon Jun 03, 2013 9:31 pm

Hi Venkat,

You may try this code-

//STEP00 EXEC PGM=SORT                   
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
2013-01-31
2013-02-28
2013-03-31
//SORTOUT   DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,2,ZD)),
        IFTHEN=(WHEN=(81,2,ZD,EQ,+1),BUILD=(01:C'//SET SET DATE=',
                                     3,2,6,2,9,2)),
        IFTHEN=(WHEN=(81,2,ZD,EQ,+2),BUILD=(01:C'//SET SET DATE1=',
                                     3,2,6,2,9,2)),
        IFTHEN=(WHEN=(81,2,ZD,EQ,+3),BUILD=(01:C'//SET SET DATE2=',
                                     3,2,6,2,9,2))


And O/p -
//SET SET DATE=130131
//SET SET DATE1=130228
//SET SET DATE2=130331
Thanks
-3nadh
User avatar
bodatrinadh
 
Posts: 67
Joined: Thu Jan 12, 2012 9:05 pm
Has thanked: 0 time
Been thanked: 4 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post