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

Syncsort->convert Packed Julian Date (CCYYDDD) to mmddyyy


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Thu Jul 31, 2008 1:57 am
Reply with quote

I have 2 Packed Julian date fields consecutively starting at positions 9 and 13 respectively in a VSAM file. My requirement is to copy the entire VSAM file (total length 41) to a flat file but convert the Packed Julian date (CCYYDDD) to Gregorian Date (MMDDCCYY). Please help me on this.
We are using Syncsort version 1.3.0.0N.

Thank You.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Aug 01, 2008 1:01 am
Reply with quote

This feature is available in SyncSort for z/OS 1.3 via OUTREC DT or OUTREC DTNS.
Back to top
View user's profile Send private message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Fri Aug 01, 2008 8:07 pm
Reply with quote

I searched SYNCSORT Version 1.3 Manual. I could not find format CCYYDDD as input date filed. I could see YYDDD format only.
Back to top
View user's profile Send private message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Sat Aug 02, 2008 2:26 am
Reply with quote

Since I could not find CCYYDDD as input format. I ignored CC portion and wanted to test X'yyddds' format.
I used following sort statements.
Code:
  SORT FIELDS=COPY                   
  OUTREC FIELDS=(10,3,Y2U,DTNS=(MD4))


The job ran fine. But Output got messed up. In My input file I was having date '88005' (though I was having 19 as CC at 9th Position in Packed Decimal format) in packed decimal format. I got the output as 01052088.
It should have been 01051988.
Could you please let me know how to correct this situation.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Aug 02, 2008 3:10 am
Reply with quote

Hello,

Please post a few input records, the output produced from those records and the output you wanted rather than what was produced.

Please use the "Code" tag for each set of records. You can use Preview to see how your post will appear to the forum before you Submit.
Back to top
View user's profile Send private message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Mon Aug 04, 2008 5:48 pm
Reply with quote

I have input as

Code:
abcdefgh19880051989006pqrs
abcdefgg20000072001008abcc


I got output as
Code:
abcdefgh19010520881901062089pqrs
abcdefgg20010721002001082101abcc


I need output as

Code:
abcdefgh0105198801061989pqrs
abcdefgg0107200001082001abcc
Back to top
View user's profile Send private message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Tue Aug 05, 2008 2:58 am
Reply with quote

There is a small correction to the required output format.

Code:
abcdefgh01/05/198801/06/1989pqrs
abcdefgg01/07/200001/08/2001abcc
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Aug 05, 2008 6:10 pm
Reply with quote

Hello muralee.

Quote:
I got the output as 01052088.
It should have been 01051988.
Could you please let me know how to correct this situation.


See the manual for CENTWIN parameter. It will allow you to define your own rules while converting 2 digit year to 4 digit year. It can be specified as a parm or in the control card itself.

Thanks,
Arun
Back to top
View user's profile Send private message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Thu Aug 07, 2008 9:52 pm
Reply with quote

Thank You Arun.
The following code worked for me.

Code:
  SORT FIELDS=COPY,                   
  CENTWIN=1949                       
  OUTREC FIELDS=(10,3,Y2U,DT=(MD4/))   


I am surprised to know that Latest Syncsort version also doesn't have
the CCYYDDD format for the input Date criteria and we have to use CENTWIN command to tackle this.

Thank You All for helping me to resolve this problem.
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 -> JCL & VSAM

 


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 Compare only first records of the fil... SYNCSORT 7
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
Search our Forums:

Back to Top