Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

alphanumeric date to comp-3 format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: alphanumeric date to comp-3 format
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 Moderator


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

PostPosted: Fri Jun 05, 2009 3:37 am    Post subject:
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 Moderator


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

PostPosted: Wed Nov 18, 2009 3:20 am    Post subject:
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    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 How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us