View previous topic :: View next topic
|
Author |
Message |
wastedmaky
New User
Joined: 06 Oct 2006 Posts: 5 Location: manila, philippines
|
|
|
|
Can anyone help me in converting SAS date into JULIAN date or how can I change PACKED Decimal into YYMMDD format.. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Alan Voss
New User
Joined: 29 Nov 2006 Posts: 32 Location: Jacksonville, FL
|
|
|
|
SAS dates are stored relative to 1JAN1960 = 0. They are stored as IBM mainframe floating point numbers (8 bytes). |
|
Back to top |
|
|
wastedmaky
New User
Joined: 06 Oct 2006 Posts: 5 Location: manila, philippines
|
|
|
|
@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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Alan Voss
New User
Joined: 29 Nov 2006 Posts: 32 Location: Jacksonville, FL
|
|
|
|
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 |
|
|
demora
New User
Joined: 12 Dec 2006 Posts: 4 Location: Cleveland, OH
|
|
|
|
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 |
|
|
Alan Voss
New User
Joined: 29 Nov 2006 Posts: 32 Location: Jacksonville, FL
|
|
|
|
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 |
|
|
wastedmaky
New User
Joined: 06 Oct 2006 Posts: 5 Location: manila, philippines
|
|
|
|
Thanks to everyone..the problem has been solved by allan voss |
|
Back to top |
|
|
|