View previous topic :: View next topic
|
Author |
Message |
abraralum
New User
Joined: 19 Dec 2010 Posts: 42 Location: Bangalore
|
|
|
|
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 |
|
|
abraralum
New User
Joined: 19 Dec 2010 Posts: 42 Location: Bangalore
|
|
|
|
As a additional info the Julian date is in PD format. Any pointers will be very helpful.
Thanks. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
fredrick andrews
New User
Joined: 10 Jun 2010 Posts: 52 Location: chennai
|
|
Back to top |
|
|
abraralum
New User
Joined: 19 Dec 2010 Posts: 42 Location: Bangalore
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
"this subparameter"? Is the keyword THIS? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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. . .
Have a great weekend!
d |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
publically publishing |
how many beers would it take to discuss about private publishing |
|
Back to top |
|
|
abraralum
New User
Joined: 19 Dec 2010 Posts: 42 Location: Bangalore
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
You need to determine what the data really is.
is NOT a packed decimal fielld. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
|