BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Vijay77
Fluorite | Level 6

Hi There,

           i have a date variable in below format how to convert it to ISO 8601 date format

 

B_date

22AUG19:18:39:28
31AUG19:08:42:53
09SEP19:19:21:23

 

1 ACCEPTED SOLUTION

Accepted Solutions
ed_sas_member
Meteorite | Level 14

Hi @Vijay77 

 

Something like this ?

 

data;
	input B_date:datetime16.;
	format B_date E8601DT.;
	datalines;
22AUG19:18:39:28
31AUG19:08:42:53
09SEP19:19:21:23
;
run;

Capture d’écran 2019-12-17 à 12.30.32.png

 

https://documentation.sas.com/?docsetId=leforinforref&docsetTarget=p0jd9jaqmxd2ezn1kncmpgfqcpiz.htm&...

 

View solution in original post

3 REPLIES 3
ed_sas_member
Meteorite | Level 14

Hi @Vijay77 

 

Something like this ?

 

data;
	input B_date:datetime16.;
	format B_date E8601DT.;
	datalines;
22AUG19:18:39:28
31AUG19:08:42:53
09SEP19:19:21:23
;
run;

Capture d’écran 2019-12-17 à 12.30.32.png

 

https://documentation.sas.com/?docsetId=leforinforref&docsetTarget=p0jd9jaqmxd2ezn1kncmpgfqcpiz.htm&...

 

Vijay77
Fluorite | Level 6

need to create a new variable C_date and add B_date Values to C_date variable

ed_sas_member
Meteorite | Level 14

Hi @Vijay77 

 

Could you please clarify your request by providing sample data and desired output?

Thank you! 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 754 views
  • 1 like
  • 2 in conversation