Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort - Julian Date to normal date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Julian Date to normal date
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    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

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

ftp://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    Post subject:
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Feb 25, 2011 11:52 pm    Post subject:
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

Site Director


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

PostPosted: Sat Feb 26, 2011 12:02 am    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Feb 26, 2011 12:17 am    Post subject:
Reply with quote

"this subparameter"? Is the keyword THIS? icon_lol.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sat Feb 26, 2011 12:44 am    Post subject: Reply to: Syncsort - Julian Date to normal date
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: 2158
Location: @my desk

PostPosted: Sat Feb 26, 2011 8:31 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Feb 26, 2011 10:57 pm    Post subject: Reply to: Syncsort - Julian Date to normal date
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    Post subject:
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: 7912
Location: Bellevue, IA

PostPosted: Sun Feb 27, 2011 7:51 pm    Post subject:
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: 2158
Location: @my desk

PostPosted: Sun Feb 27, 2011 9:20 pm    Post subject:
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    Post subject:
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: 2158
Location: @my desk

PostPosted: Tue Mar 01, 2011 7:22 pm    Post subject:
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: 2158
Location: @my desk

PostPosted: Tue Mar 01, 2011 7:35 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us