Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Date conversion : Julian to YYMMDD in SAS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: Date conversion : Julian to YYMMDD in SAS
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    Post subject: Reply to: Date conversion : Julian to YYMMDD in SAS
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: 7935
Location: Bellevue, IA

PostPosted: Thu Dec 04, 2008 5:25 am    Post subject:
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    Post subject: Reply to: Date conversion : Julian to YYMMDD in SAS
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: 7935
Location: Bellevue, IA

PostPosted: Thu Dec 04, 2008 7:11 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us