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: 8057
Location: East Dubuque, Illinois, USA

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: 8057
Location: East Dubuque, Illinois, USA

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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


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