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



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

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:

//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/))
/*
 



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 ....
N J Baruah
 
Posts: 12
Joined: Wed Apr 04, 2018 6:02 pm
Has thanked: 1 time
Been thanked: 0 time

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/
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

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
Has thanked: 1 time
Been thanked: 0 time

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:

//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)
/*
 



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:


//SORTIN DD *
2017.335
2018.106
 
N J Baruah
 
Posts: 12
Joined: Wed Apr 04, 2018 6:02 pm
Has thanked: 1 time
Been thanked: 0 time

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
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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.
N J Baruah
 
Posts: 12
Joined: Wed Apr 04, 2018 6:02 pm
Has thanked: 1 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post