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

Date conversion : Julian to YYMMDD in SAS


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

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Thu Dec 04, 2008 1:32 am
Reply with quote

Hi,

I want to convert a Julian date to format YYMMDD in SAS
Can someone pls advice how to do that ??


thanks
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Dec 04, 2008 3:19 am
Reply with quote

Code:

     JULDTE = DATEJUL(08338);               
     YYMMDD = PUT(JULDTE,YYMMDD6.);         


Your julian goes into the DATEJUL function and is converted to a SAS numerical date stored in the JULDTE variable. The PUT function loads the JULDTE variable into the YYMMDD format and is now loaded into variable YYMMDD.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Dec 04, 2008 5:25 am
Reply with quote

For input, use JULIANw. or PDJULw. (if packed) format to read in the Julian date. Then use a FORMAT varname YYMMDD6. ; to output as YYMMDD6. format. SAS dates are stored as an integer number of days since January 1, 1960 and can be output as desired by using the FORMAT statement.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Thu Dec 04, 2008 6:26 am
Reply with quote

Thanks all, it work for me. Pls see the code below:

Code:
REG_DTE    $CHAR7
REG_DTE1  = DATEJUL(REG_DTE)
PUT @1  REG_DTE1  MMDDYY6.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Dec 04, 2008 7:11 am
Reply with quote

Glad to hear it worked.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts IBM IMU Utility for Easytrieve Code t... IBM Tools 0
No new posts Sort card to know that creation date ... DFSORT/ICETOOL 10
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 11
No new posts GDG generation name to GDG Base name ... DFSORT/ICETOOL 3
Search our Forums:


Back to Top