IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

CONVERSION of SAS date to JULIAN DATE


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
wastedmaky

New User


Joined: 06 Oct 2006
Posts: 5
Location: manila, philippines

PostPosted: Thu Dec 14, 2006 1:49 pm
Reply with quote

Can anyone help me in converting SAS date into JULIAN date or how can I change PACKED Decimal into YYMMDD format..
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Dec 14, 2006 9:49 pm
Reply with quote

What does the SAS date look like exactly in hex and what do you want the converted date to look like in hex? What is the starting position and length of the SAS date field in the input record? What is the RECFM and LRECL of the input file?
Back to top
View user's profile Send private message
Alan Voss

New User


Joined: 29 Nov 2006
Posts: 32
Location: Jacksonville, FL

PostPosted: Fri Dec 15, 2006 12:55 am
Reply with quote

SAS dates are stored relative to 1JAN1960 = 0. They are stored as IBM mainframe floating point numbers (8 bytes).
Back to top
View user's profile Send private message
wastedmaky

New User


Joined: 06 Oct 2006
Posts: 5
Location: manila, philippines

PostPosted: Fri Dec 15, 2006 6:17 am
Reply with quote

@Frank
I have 2 dates; DATE1(run date) and
DATE2(SAS date)
I used the date 20061208 for DATE1
I have formated the SAS date(DATE2) into YYMMDD format which results to20061214
Now, I tried using this,
DIFFDT1 = DATDIF(DATE1,DATE2,'ACTUAL');
but DIFFDT1 gives me a result of 14 which i supposed to be 6.
I tried using;
DIFFDT2 = DATE1-DATE2 but it give me a result of -2E7
my RECFM=FB and LRECL=80
the position of SAS date is
@26 DATE2 YYMMDDN8;
Thanks for your help
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Dec 15, 2006 8:24 pm
Reply with quote

wastedmaky,

Since this is the DFSORT/ICETOOL Forum, I thought you were asking how to do something with DFSORT/ICETOOL.

DIFFDT1 = DATDIF(DATE1,DATE2,'ACTUAL');

is not a DFSORT/ICETOOL statement, so you're obviously using some other language (SAS?). I can't help you with that.

I'd suggest posting in a more appropriate Forum.
Back to top
View user's profile Send private message
Alan Voss

New User


Joined: 29 Nov 2006
Posts: 32
Location: Jacksonville, FL

PostPosted: Fri Dec 15, 2006 8:40 pm
Reply with quote

I can answer this off line. Please contact me at ** Email Removed **

** The use of email addresses is prohibited. Use the "Private Messages" facility. **
Back to top
View user's profile Send private message
demora

New User


Joined: 12 Dec 2006
Posts: 4
Location: Cleveland, OH

PostPosted: Sat Dec 16, 2006 1:35 am
Reply with quote

As long as your DATE1 is also set up as a SAS date format like DATE1=TODAY(); Then you should be able to used the DATEDIF=DATE1-DATE2; and it should work. To convert to julian dates, then you have to change DATE2 into a julian date by using the JULDATE7 function. Something like DATE2JUL=JUDATE7(DATE2); I haven't tested this to know if it works though.

SAS Doc online - support.sas.com/onlinedoc/913/docMainpage.jsp
Back to top
View user's profile Send private message
Alan Voss

New User


Joined: 29 Nov 2006
Posts: 32
Location: Jacksonville, FL

PostPosted: Sat Dec 16, 2006 3:02 am
Reply with quote

Please understand...If you want to do interval calculations, etc, leave your dates, times, and datetimes as SAS dates, times, and datetimes. The SAS date, time, and datetime functions handle just about everything that you can imagine, and a few things that you probably shouldn't.

As long as you plan ahead, and assign formats to these variables, everything remains readable and fairly obvious.
Back to top
View user's profile Send private message
wastedmaky

New User


Joined: 06 Oct 2006
Posts: 5
Location: manila, philippines

PostPosted: Sun Dec 24, 2006 5:27 pm
Reply with quote

Thanks to everyone..the problem has been solved by allan voss
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top