Natural date type correspondence



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

Natural date type correspondence

Postby tivrfoa » Tue Jun 04, 2013 9:46 pm

Hi,

The data in ADABAS is D 6. When a display it in a Natural program it shows in the format ddmmyyyy.
I call the program from JCL that writes this data to a dataset, but I don't know what to use in EDIT for this type.
I tried BI, FI, and others without success. What I must use with OUTREC EDIT?

The Natural program simply writes the data direct from the view:
READ CDA060
WRITE WORK FILE 1 CDA060
END-READ

Thank you.
tivrfoa
 
Posts: 83
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 58 times
Been thanked: 0 time

Re: Natural date type correspondence

 

Re: Natural date type correspondence

Postby tivrfoa » Tue Jun 04, 2013 11:36 pm

For example, it displays 11122012 in Natural, and when I use 42,04,PD,EDIT=(TTTTTTTT) it becomes 00735212.
tivrfoa
 
Posts: 83
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 58 times
Been thanked: 0 time

Re: Natural date type correspondence

Postby dick scherrer » Tue Jun 04, 2013 11:54 pm

Hello,

Suggest you show the date in HEX (in ADABAS). I suspect it is not PD.
Hope this helps,
d.sch.

These users thanked the author dick scherrer for the post:
tivrfoa (Wed Jun 05, 2013 1:13 am)
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Natural date type correspondence

Postby tivrfoa » Tue Jun 04, 2013 11:59 pm

dick scherrer wrote:Hello,

Suggest you show the date in HEX (in ADABAS). I suspect it is not PD.


I set hex on in the dataset before the SORT.
Natural: 11122012
Hex:
0322
751F
tivrfoa
 
Posts: 83
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 58 times
Been thanked: 0 time

Re: Natural date type correspondence

Postby dick scherrer » Wed Jun 05, 2013 12:58 am

Well, that value is valid for a packed-decimal field. It is not however, the way many(most) PD dates are stored.

Look in the ADADBAS documentation for an explanation of how this date is stored. It may be the difference in days from some control date.
Hope this helps,
d.sch.

These users thanked the author dick scherrer for the post:
tivrfoa (Wed Jun 05, 2013 1:13 am)
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Natural date type correspondence

Postby Akatsukami » Wed Jun 05, 2013 11:22 pm

It looks like the number of days since 1 Jan 1 CE.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day

These users thanked the author Akatsukami for the post:
tivrfoa (Thu Jun 06, 2013 2:17 am)
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Natural date type correspondence

Postby tivrfoa » Thu Jun 06, 2013 2:51 am

Akatsukami wrote:It looks like the number of days since 1 Jan 1 CE.

Nice observation.
I checked in this site: http://www.timeanddate.com/date/duration.html

And got:

PD,EDIT NATURAL DAYS IN SITE
00735212 -> 11122012 ->>> 734,849
00735187 -> 16112012 ->>> 734,824
00733848 -> 18032009 ->>> 733,485

Now I'll try to find a way to convert this date in days to this format ddmmyyyy.
Thank you.
tivrfoa
 
Posts: 83
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 58 times
Been thanked: 0 time

Re: Natural date type correspondence

Postby Akatsukami » Thu Jun 06, 2013 3:11 pm

The number of days between 1 Jan 1 CE in the Julian calendar and 15 Oct 1582 CE in the Gregorian calendar (which is Lilian day 1) is 577,737. Depending on what language you're using, you may be able to subtract that number minus one from the date and then use the LE function CEEDATE to get a Gregorian date.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Natural date type correspondence

Postby tivrfoa » Fri Jun 14, 2013 8:55 pm

Akatsukami wrote:The number of days between 1 Jan 1 CE in the Julian calendar and 15 Oct 1582 CE in the Gregorian calendar (which is Lilian day 1) is 577,737. Depending on what language you're using, you may be able to subtract that number minus one from the date and then use the LE function CEEDATE to get a Gregorian date.

Thank you Akatsukami.
I went to the link you gave and CEEDATE function needs to called from a program, so it was simple to convert in the Natural program:
MOVE EDITED DT-PEDIDO-060(EM=DDMMYYYY) TO #DT-PEDIDO-060

I looked if Syncsort can do this, but couldn't find a way.

Thanks again.
tivrfoa
 
Posts: 83
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 58 times
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post