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

Convert PD Julian date (CCYYDDD) to Greg Date - SyncSort


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

New User


Joined: 24 Jun 2007
Posts: 57
Location: US

PostPosted: Wed Dec 31, 2008 2:30 am
Reply with quote

Hi,

My Input file has the date as CCYYDDD format and it is in Packed Decimal. I need to convert it to MM/DD/YY format. I couldn't found abot PD dates converison in the existing posts.

Could some please help me?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Dec 31, 2008 10:34 am
Reply with quote

Hi,

This feature is available in SyncSort for z/OS 1.3 via OUTREC DT or OUTREC DTNS. You might need to use CENTWIN parameter as well. To get a better help, please tell the position of Date field & the SORT product you are using - in case it's SyncSort you need to tell what version of this is in use at your shop.
Back to top
View user's profile Send private message
jpdeshai

New User


Joined: 24 Jun 2007
Posts: 57
Location: US

PostPosted: Tue Jan 06, 2009 2:40 am
Reply with quote

Hi Anuj,

The Vesrion is SYNCSORT FOR Z/OS 1.2.3
The Date Positions details are given below:
FIELD LEVEL/NAME ---------- -PICTURE- -NUMBER START END LENGTH
-LAST-REQ-DATE S9(7) 10 41 44 4

As you can see It's a COMP-3 field.

Plea suggest the solution.
(Sorry I was away for long weekend)
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Jan 06, 2009 2:04 pm
Reply with quote

jpdeshai,

The below SyncSort job does what you're trying to achieve. It works with my SyncSort version (SYNCSORT FOR Z/OS 1.2.1.0R). Please note that it assumes that the input file has CC values of 19,20 and 21 only.

Code:
//STEP01   EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN= Input file ---- FB/LRECL=80             
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  INREC IFTHEN=(WHEN=(44,1,CH,EQ,X'19'),OVERLAY=(44:X'00')),
        IFTHEN=(WHEN=(44,1,CH,EQ,X'20'),OVERLAY=(44:X'01')),
        IFTHEN=(WHEN=(44,1,CH,EQ,X'21'),OVERLAY=(44:X'02'))
  SORT  FIELDS=COPY                                         
  OUTREC FIELDS=(44,4,DT1)                                 
  OUTFIL BUILD=(5,2,C'/',7,2,C'/',3,2)                     
/*                                                         
Input
Code:
IN-DATE 
4/PS     
(44-47) 
2--------
  1998365
  2008366
  2009001
  2009010
  2100060
SORTOUT
Code:
12/31/98
12/31/08
01/01/09
01/10/09
03/01/00
Back to top
View user's profile Send private message
jpdeshai

New User


Joined: 24 Jun 2007
Posts: 57
Location: US

PostPosted: Tue Jan 06, 2009 8:26 pm
Reply with quote

Thanks arcvns.
Back to top
View user's profile Send private message
jpdeshai

New User


Joined: 24 Jun 2007
Posts: 57
Location: US

PostPosted: Tue Jan 06, 2009 10:31 pm
Reply with quote

Hey Arcvns,

Once again thnx for the help, It worked perfectly to me. I just changed a bit as per my layout & needs.
Code:

INREC IFTHEN=(WHEN=(41,1,CH,EQ,X'19'),OVERLAY=(41:X'00')),           
      IFTHEN=(WHEN=(41,1,CH,EQ,X'20'),OVERLAY=(41:X'01')),           
      IFTHEN=(WHEN=(41,1,CH,EQ,X'21'),OVERLAY=(41:X'02'))           
SORT FIELDS=COPY                                                     
INCLUDE COND=(1,1,CH,NE,C'0')                                       
OUTREC IFTHEN=(WHEN=INIT,                                           
        BUILD=(1:30,05,PD,M10,12:05,19,32:51,01,39:45,06,PD,M18,     
               54:35,06,PD,M18,70:41,4,DT1,                         
               83:52,6,PD,M18,100:58,06,PD,M18,118:64,06,PD,M18)),   
IFTHEN=(WHEN=(70,4,CH,EQ,C'1900'),OVERLAY=(70:C'       0'))         
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Jan 06, 2009 10:52 pm
Reply with quote

JP,

You're welcome.
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 Keep leading zero(s) after convert fl... SYNCSORT 7
Search our Forums:

Back to Top