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

Coonvert PD to Julian date format in SAS


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
piglet

New User


Joined: 05 Sep 2006
Posts: 6

PostPosted: Thu Dec 14, 2006 2:19 pm
Reply with quote

Is there a way to convert a packed decimal format date into Julian Date?

I need to convert the value below 20061208 into a date format that SAS can understand.

Code:
../.?
00628
2010C


I need this to be able to calculate the difference between this date (20061208) and today's date (DATE()).

Thanks!
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 1:11 am
Reply with quote

data dates;
infile dates;
input @1 pd_dt pd5.;
sas_dt = input(put(pd_dt,z8.),yymm8.);
format sas_dt yymmdd10.;
diff = today()-sas_dt;
run;

proc print data=dates;
run;
Back to top
View user's profile Send private message
piglet

New User


Joined: 05 Sep 2006
Posts: 6

PostPosted: Fri Dec 15, 2006 12:43 pm
Reply with quote

Thanks for your help!

This worked beautifully! icon_biggrin.gif
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
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