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.