IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Date conversion using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 25, 2007 11:16 pm
Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed that you wanted both output dates in the form mm-dd-yyyy. If you want dd-mm-yyyy that would require a simple change to the last IFTHEN clause.

Code:

//S1    EXEC  PGM=ICEMAN                                     
//SYSOUT    DD  SYSOUT=*                                     
//SORTIN DD DSN=... input file (FB/80)                       
//SORTOUT DD DSN=...  output file (FB/80)                     
//SYSIN    DD    *                                           
  OPTION COPY,Y2PAST=1920                                     
  INREC IFTHEN=(WHEN=INIT,                                   
          BUILD=(1,8,                                         
            9:9,4,                                           
           19:13,3,                                           
           22:16,5,Y2T,TO=PD,LENGTH=4)),                     
  IFTHEN=(WHEN=INIT,                                         
    OVERLAY=(9:9,1,CHANGE=(1,X'19',X'00',X'20',X'01'),       
            NOMATCH=(X'02'),                                 
            22:22,1,CHANGE=(1,X'19',X'00',X'20',X'01'),       
            NOMATCH=(X'02'))),                               
  IFTHEN=(WHEN=INIT,                                         
    OVERLAY=(9:9,4,DT1,                                       
            22:22,4,DT1)),                                   
  IFTHEN=(WHEN=INIT,                                         
    BUILD=(1,8,                                               
           9:13,2,C'-',15,2,C'-',9,4,                         
           19:13,3,                                           
           22:26,2,C'-',28,2,C'-',22,4,80:X))                 
/*                                                           
Back to top
View user's profile Send private message
sureshbabuamara

New User


Joined: 20 Sep 2007
Posts: 16
Location: India

PostPosted: Mon Oct 29, 2007 4:35 pm
Reply with quote

Thankyou very very much Mr.Frank.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Nov 24, 2009 2:21 am
Reply with quote

With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), DFSORT now has built-in date conversion functions for these types of situations . For complete details on date conversion functions and the other new functions available with the Nov, 2009 DFSORT PTF, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts 10 byte RBA conversion DB2 2
Search our Forums:

Back to Top