BookmarkSubscribeRSS Feed
mahender1
Fluorite | Level 6

Hello all,

kindly help me in converting the date values to ISO8601 format.

i have date values as :

TRTSTDT and TRENDT are NUMERIC type as below:

 

   TRSTDT            TRENDT

06DEC2007       20DEC2007

16JUN2009       30JUN2009

 

I want to convert them to CHARACTER variables as

RFSTDTC and RFENDTC to ISO8601 format,

 

 

Kindly help me.

 

 

 

 

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

Whn you say ISO 8601 Format, does that mean that 06DEC2007 becomes 20071206? 🙂

Tom
Super User Tom
Super User

What did you try? SAS has a number of ISO  formats.  

https://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n0p2fmevfgj...

RFSTDTC = put(TRTSTDT,B8601DA8.);

Of course you could also just use the YYMMDDN format.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 964 views
  • 0 likes
  • 3 in conversation