convert YYMMDD to MM/DD/CCYY



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

convert YYMMDD to MM/DD/CCYY

Postby ranga_subham » Tue May 12, 2009 3:59 pm

Hi,

I receive date in YYMMDD format and want to convert it to MM/DD/CCYY.

Please help me with a SORT card for this. We use Syncsort v2.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: convert YYMMDD to MM/DD/CCYY

Postby Alissa Margulies » Tue May 12, 2009 8:31 pm

Here is an example of a SyncSort for z/OS 1.2 job that will do what you asked:
//SORT1 EXEC PGM=SORT,PARM='CENTWIN=80'   
//SORTIN  DD *                                           
990126 
090512                                                 
//SORTOUT DD SYSOUT=*                                   
//SYSOUT  DD SYSOUT=*                                     
//SYSIN   DD *                                             
   SORT FIELDS=COPY                                       
   OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,6,Y2T)),             
          IFTHEN=(WHEN=INIT,BUILD=(5,2,C'/',7,2,C'/',1,4))
/* 

This is the output produced:
01/26/1999
05/12/2009
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: convert YYMMDD to MM/DD/CCYY

Postby ranga_subham » Thu May 14, 2009 9:14 am

Thank you very much :D
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: convert YYMMDD to MM/DD/CCYY

Postby ranga_subham » Thu May 14, 2009 5:39 pm

Another method - Just thought to share it here:

//SORT0001 EXEC PGM=SORT                 
//SORTIN   DD *                           
090701                                   
710701                                   
/*                                       
//SORTOUT  DD SYSOUT=*                   
//SYSOUT   DD SYSOUT=*                   
//SYSIN    DD *                           
 SORT FIELDS=COPY,CENTWIN=1970           
 OUTREC FIELDS=(3,2,C'/',5,2,C'/',1,2,Y2C)
/*                                       


Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post