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

Syncsort - Julian Date to normal date


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

New User


Joined: 19 Dec 2010
Posts: 42
Location: Bangalore

PostPosted: Thu Feb 24, 2011 8:02 pm
Reply with quote

Hi,

Please can any one suggest me how to convert the Julian date-YYDDD format to regular date format.

Ex:
Input :
09185

Output:
7/4/2009


Thanks!!
Back to top
View user's profile Send private message
abraralum

New User


Joined: 19 Dec 2010
Posts: 42
Location: Bangalore

PostPosted: Thu Feb 24, 2011 9:17 pm
Reply with quote

As a additional info the Julian date is in PD format. Any pointers will be very helpful.

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

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Feb 24, 2011 11:21 pm
Reply with quote

abraralum,

Assuming that your input PD date p'yyddd' is at position 10, you can use the following control cards to get the Gregorian date in(MM/DD/CCYY ) format at pos 20.

Code:

//SYSIN DD *
  SORT FIELDS=COPY
  OUTREC OVERLAY=(20:10,3,Y2U,TOGREG=Y4W(/))
//*
Back to top
View user's profile Send private message
fredrick andrews

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Fri Feb 25, 2011 3:23 pm
Reply with quote

This is covered in the Smart DFSORT tricks pdf available here :

ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf


Thanks!
Back to top
View user's profile Send private message
abraralum

New User


Joined: 19 Dec 2010
Posts: 42
Location: Bangalore

PostPosted: Fri Feb 25, 2011 6:21 pm
Reply with quote

Hi Kolusu,

Thanks for your reply.

I tried the below previously also (I searched in the forum and got the below code).

Code:
OUTREC OVERLAY=(20:10,3,Y2U,TOGREG=Y4W(/))


I have and am getting the error as below:

Code:
    OUTREC OVERLAY=(20:1,3,Y2U,TOGREG=Y4W(/))
                               *             
             OUTREC STATEMENT  : SYNTAX ERROR   



My Sysin card is as below:
Code:

//SP EXEC PGM=SORT   
//SYSOUT DD SYSOUT=* 
//SORTIN DD *         
  09185               
/*         


(I have changed the positions in Outrec while running the job)
Please advise. Thanks !
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Feb 25, 2011 10:44 pm
Reply with quote

abraralum,

Is there a reason as to why you did not show me the complete error messages? I am guessing that you are using syncsort which does NOT support TOGREG function. Show me the complete sysout with error messages so that we can determine your product.
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 Feb 25, 2011 11:52 pm
Reply with quote

abraralum,

That message indicates you are using Syncsort, not DFSORT. TOGREG works fine with DFSORT but is NOT supported by Syncsort. In the future, please ask Syncsort questions in the JCL Forum.
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 Feb 26, 2011 12:02 am
Reply with quote

Hello,

From the Syncsort 1.3 manual:
Quote:
Use this subparameter together with the p,l elements to indicate
the conversion of a full-date Julian date field to a printable
Gregorian date.

This is in the OUTREC material and there is much more of it.
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: Sat Feb 26, 2011 12:17 am
Reply with quote

"this subparameter"? Is the keyword THIS? icon_lol.gif
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 Feb 26, 2011 12:44 am
Reply with quote

Hi Frank,

Keeping with the policy of Syncsort to refrain from publically publishing the documentation, i used the quote above.

My intent was to show abraralum that the solution was available. . . icon_wink.gif

Have a great weekend!

d
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sat Feb 26, 2011 8:31 pm
Reply with quote

This Syncsort card assumes the PD field is at pos 1-3 and the cc stands for '20' only.
Code:
//SYSIN    DD   *                                       
  INREC BUILD=(X'01',1,3)                               
  SORT FIELDS=COPY                                       
  OUTREC IFOUTLEN=10,IFTHEN=(WHEN=INIT,                 
         OVERLAY=(81:1,4,DT1,1:85,2,C'/',87,2,C'/',81,4))
SORTOUT
Code:
07/04/2009
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Sat Feb 26, 2011 10:57 pm
Reply with quote

Quote:
publically publishing


how many beers would it take to discuss about private publishing icon_biggrin.gif
Back to top
View user's profile Send private message
abraralum

New User


Joined: 19 Dec 2010
Posts: 42
Location: Bangalore

PostPosted: Sun Feb 27, 2011 4:58 pm
Reply with quote

Thanks for your reply. Surely I will keep in mind in future.

I tried as you suggested above, but ended up in SOC7. I suspect it might be because of the OVERLAY statemnt positions. I tried modifying that and running the job but no luck, ended up in coming back to you.

my Input as below :

Code:

//SP EXEC PGM=SORT             
//SYSOUT DD SYSOUT=*           
//SORTIN DD *                   
09185                         
/*                             
//SORTOUT DD SYSOUT=*           


and my SYSIN statemnt is exactly as above.

Code:

Error: Unsuccessful sort 0c7 s
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sun Feb 27, 2011 7:51 pm
Reply with quote

You need to determine what the data really is.
Code:
09185
is NOT a packed decimal fielld.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sun Feb 27, 2011 9:20 pm
Reply with quote

abraralum wrote:
my SYSIN statemnt is exactly as above
But your input data is n't.
abraralum wrote:
As a additional info the Julian date is in PD format
You have violated your own rule of input data being PD.
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Mar 01, 2011 10:04 am
Reply with quote

This code will convert the julian date to gregorian date in SYNCSORT. This will not work for PD format. Assuming your input value starts at 1st byte

Code:
SORT FIELDS=COPY                   
OUTREC FIELDS=(1,5,Y2T,DT=(MD4/)) 
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Mar 01, 2011 7:22 pm
Reply with quote

Y2U can be used for the OPs requirement which works on a 3-byte PD input field in the format 'yyddds'.
Code:
//SYSIN    DD *                               
  OPTION COPY                                 
  INREC BUILD=(1,3,Y2U,DT=(MD4/))                   
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Mar 01, 2011 7:35 pm
Reply with quote

Adding to the above, the DT parameter works along with the CENTWIN parm which helps in resolving the 2-digit years into YYYY format. Hence it needs to be made sure that the CENTWIN parameter is set to the appropriate value.
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 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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top