Binary date to gregorian Date



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

Binary date to gregorian Date

Postby mail4rsb » Tue Nov 12, 2013 10:05 pm

I have a two bit binary date field in the input file and i need to convert to a greg date MM/DD/YYYY.
can it be converted using sysnsort. Please let me know

Thank you
mail4rsb
 
Posts: 6
Joined: Tue Nov 12, 2013 12:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: Binary date to gregorian Date

 

Re: Binary date to gregorian Date

Postby steve-myers » Tue Nov 12, 2013 10:07 pm

It is simply not possible to represent a "date" in a 2 bit data area. Do you mean 2 bytes?
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Binary date to gregorian Date

Postby mail4rsb » Tue Nov 12, 2013 10:14 pm

yes its two bytes sorry for the cofusion
mail4rsb
 
Posts: 6
Joined: Tue Nov 12, 2013 12:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: Binary date to gregorian Date

Postby steve-myers » Tue Nov 12, 2013 10:51 pm

How the "date" stored in the 2 bytes?
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Binary date to gregorian Date

Postby mail4rsb » Tue Nov 12, 2013 11:10 pm

the document says its binary date. one cobol program is reading it as X(02) and calling a assembler routine to convert the binary date to gregorian date...
mail4rsb
 
Posts: 6
Joined: Tue Nov 12, 2013 12:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: Binary date to gregorian Date

Postby Akatsukami » Tue Nov 12, 2013 11:15 pm

Whilst I can think of ways to stuff a (non-Y2K compliant) pseudo-Julian date into two bytes, IMPO that would have been a waste of ingenuity back in the S/360 days. I would like to see some bit patterns and the corresponding Gregorian dates.
"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: Binary date to gregorian Date

Postby steve-myers » Tue Nov 12, 2013 11:30 pm

Akatsukami is correct. For example, you can store 13316 (November 12, 1913? 2013?) in 2 bytes, but it is not Y2K compliant! 113316 (which is Y2K compliant, sort of) cannot be stored in 2 bytes.

How soon the lessons of the Y2K disaster have been forgotten! This does not bode well for the more difficult 2100 problem, though none of us will be around for it!
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Binary date to gregorian Date

Postby mail4rsb » Wed Nov 13, 2013 12:32 am

Thank you Steve-myers and Akatsukami for the details.Initially i thought of unpacking the binary and then convert to MM/DD/YYYY in few SORT steps. buy i think it wont work
mail4rsb
 
Posts: 6
Joined: Tue Nov 12, 2013 12:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: Binary date to gregorian Date

Postby Akatsukami » Wed Nov 13, 2013 12:42 am

"Unpacking the binary" makes no sense; a binary number is quite different from a packed decimal number. Moreover, a two-byte packed decimal field could hold a maximum value of 999, completely inadequate for representing a date. We must see the data to say anything meaningful.
"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: Binary date to gregorian Date

Postby mail4rsb » Wed Nov 13, 2013 12:59 am

I am seeing something like this
Ç5
0N
Åà
mail4rsb
 
Posts: 6
Joined: Tue Nov 12, 2013 12:06 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post