Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DFSort- Date formatting

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
mssabirami

New User


Joined: 11 Feb 2008
Posts: 17
Location: Chennai

PostPosted: Wed Nov 18, 2009 3:40 pm    Post subject: DFSort- Date formatting
Reply with quote

Hi,

The input date needs be converted into mm/dd/ccyy format.

Input --------------------->Expected output
11/7/2009-----------------> 11/07/2009
1/27/2009-----------------> 01/27/2009
1/1/2009-------------------> 01/01/2009

If the month or date is in single digit, '0' needs to be prefixed.

Is there any way to solve this using DFSORT?
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Nov 18, 2009 4:13 pm    Post subject:
Reply with quote

Hi,

this is one way of achieving it
Code:
//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                   
11/7/2009                                                         
1/27/2009                                                         
1/1/2009                                                         
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
   SORT FIELDS=COPY                                               
     INREC IFTHEN=(WHEN=(3,1,CH,EQ,C'/',&,5,1,CH,EQ,C'/'),       
                 BUILD=(1,3,C'0',4,6)),                           
           IFTHEN=(WHEN=(2,1,CH,EQ,C'/',&,5,1,CH,EQ,C'/'),       
                 BUILD=(C'0',1,9)),                               
           IFTHEN=(WHEN=(2,1,CH,EQ,C'/',&,4,1,CH,EQ,C'/'),       
                 BUILD=(C'0',1,2,C'0',3,6))                       
/*                                                               


Gerry
Back to top
View user's profile Send private message
mssabirami

New User


Joined: 11 Feb 2008
Posts: 17
Location: Chennai

PostPosted: Wed Nov 18, 2009 6:07 pm    Post subject: Reply to: DFSort- Date formatting
Reply with quote

Thanks Gerry. Its working..
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Nov 18, 2009 11:18 pm    Post subject:
Reply with quote

mssabirami,

Here is an alternative way of doing it

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                               
11/7/2009                                                     
1/27/2009                                                     
1/1/2009                                                       
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
 SORT FIELDS=COPY                                             
 INREC PARSE=(%00=(ENDBEFR=C'/',FIXLEN=2),                     
              %01=(ENDBEFR=C'/',FIXLEN=2),                     
              %02=(FIXLEN=4)),                                 
      BUILD=(%00,UFF,EDIT=(TT),C'/',%01,UFF,EDIT=(TT),C'/',%02)
//*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us