|
View previous topic :: View next topic
|
| Author |
Message |
itmanand
New User
Joined: 18 Dec 2008 Posts: 24 Location: Newyork
|
|
|
|
| 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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|