Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
CONVERSION of SAS date to JULIAN DATE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: CONVERSION of SAS date to JULIAN DATE
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 Moderator


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

PostPosted: Thu Dec 14, 2006 9:49 pm    Post subject:
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    Post subject:
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    Post subject: re:
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 Moderator


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

PostPosted: Fri Dec 15, 2006 8:24 pm    Post subject:
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    Post subject:
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    Post subject:
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 - http://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    Post subject:
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    Post subject: Re: CONVERSION of SAS date to JULIAN DATE
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us