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

alphanumeric date to comp-3 format


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

New User


Joined: 18 Dec 2008
Posts: 24
Location: Newyork

PostPosted: Fri Jun 05, 2009 2:53 am
Reply with quote

I have date in the format X(10), yyyy-mm-dd. This needs to be converted to s9(7) comp-3 in mmddyy format using sort/icetool. Can some one help me out on this?
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: Fri Jun 05, 2009 3:37 am
Reply with quote

You can use a DFSORT job like the following changed as needed:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
2009-12-03
2008-05-30
/*
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
* Extract Z'mmddyy'
  INREC IFTHEN=(WHEN=INIT,BUILD=(6,2,9,2,3,2)),
* Convert Z'mmddyy' to P'mmddyy'
   IFTHEN=(WHEN=INIT,BUILD=(1,6,ZD,TO=PD,LENGTH=4))
/*
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: Wed Nov 18, 2009 3:20 am
Reply with quote

With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), you can use the new date conversion function TOGREG to do this:

Code:

  OPTION COPY 
* Extract Z'yyyymmdd' from C'yyyy-mm-dd'                                             
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,10,UFF,TO=ZD,LENGTH=8)), 
* Convert Z'yyyymmdd' to P'mmddyy'
        IFTHEN=(WHEN=INIT,BUILD=(1,8,Y4T,TOGREG=Y2Y))       
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

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top