convert julian date of the format "2017.335" to normal date

Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL
N J Baruah
Posts: 12
Joined: Wed Apr 04, 2018 6:02 pm
Skillset: Cobol, Jcl etc
Referer: Through Internet

convert julian date of the format "2017.335" to normal date

Postby N J Baruah » Mon Jul 30, 2018 10:44 am

Hi All,

I am trying to convert some julian dates which are in the format like "2017.335" , "2018.106" etc into normal dates of the format YY/MM/DD .
I have tried the below code:

Code: Select all


//STEP1  EXEC PGM=SORT,PARM='CENTWIN=80'
//SYSOUT DD SYSOUT=*
//SORTIN DD *
2017335
2018106
//SORTOUT DD DSN=XXXXXX.dataset,DISP=SHR
//SYSIN DD *
 SORT FIELDS=COPY
 INREC BUILD=(3,5,Y2T,DT=(4MD/))
/*
 


Code: Select all


Output: 2017/12/01
Output: 2018/04/16
 


But I want the output in the format YY/MM/DD and also when the Julian date is like " 2017.335 " , " 2018.106 " .
Can anyone please help me how I can achieve it ....

expat
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm

Re: convert julian date of the format "2017.335" to normal d

Postby expat » Mon Jul 30, 2018 11:37 am

As a quick guess, without having read a manual, did you try 2MD/ instead of 4MD/

N J Baruah
Posts: 12
Joined: Wed Apr 04, 2018 6:02 pm
Skillset: Cobol, Jcl etc
Referer: Through Internet

Re: convert julian date of the format "2017.335" to normal d

Postby N J Baruah » Mon Jul 30, 2018 11:53 am

Hi Expat,

Yeah I tried with 2MD as well...It is giving me syntax error.

N J Baruah
Posts: 12
Joined: Wed Apr 04, 2018 6:02 pm
Skillset: Cobol, Jcl etc
Referer: Through Internet

Re: convert julian date of the format "2017.335" to normal d

Postby N J Baruah » Mon Jul 30, 2018 12:32 pm

Hi Expat,

I am able to achieve in the format YY/MM/DD by doing the below:

Code: Select all


//STEP1  EXEC PGM=SORT,PARM='CENTWIN=80'
//SYSOUT DD SYSOUT=*
//SORTIN DD *
2017335
2018106
//SORTOUT DD DSN=XXXXXX.dataset,DISP=SHR  <---- LRECL=8
//SYSIN DD *
 SORT FIELDS=COPY
 INREC BUILD=(3,5,Y2T,DT=(4MD/))
 OUTREC OVERLAY=(1:3,8,9:X)
/*
 


Code: Select all


Output:  17/12/01
Output:  18/04/16
 


But how I can achieve the same result when the Julian dates are in the format "2017.335" i.e as below:

Code: Select all


//SORTIN DD *
2017.335
2018.106
 

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

Re: convert julian date of the format "2017.335" to normal d

Postby NicC » Mon Jul 30, 2018 1:38 pm

On INREC take the YY and the DDD and place them on the record as YYDDD then convert
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

N J Baruah
Posts: 12
Joined: Wed Apr 04, 2018 6:02 pm
Skillset: Cobol, Jcl etc
Referer: Through Internet

Re: convert julian date of the format "2017.335" to normal d

Postby N J Baruah » Mon Jul 30, 2018 3:12 pm

yep, Thanks NicC .... its done in the same way as u advised.


  • Similar Topics
    Replies
    Views
    Last post