DATA Step, Macro, Functions and more

Date isue

Reply
Occasional Contributor
Posts: 9

Date isue

HI All,

 

I have dates like   2017-10-05T13:00 in $22 format i want to convert it in to CDISC is860 format how i can...?

Respected Advisor
Posts: 3,277

Re: Date isue

[ Edited ]

You probably have to read it in using one of the ANYDTDTM formats to make it a numeric.

http://documentation.sas.com/?docsetId=leforinforref&docsetTarget=p1hsn1ji141r4zn0z3xm2dthop6a.htm&d...

 

Then, all you have to do is apply the desired format ISO 8601 format

http://documentation.sas.com/?docsetId=leforinforref&docsetTarget=p1a0qt18rxydrkn1b0rtdfh2t8zs.htm&d...

--
Paige Miller
Trusted Advisor
Posts: 1,163

Re: Date isue

Isn't the date 2017-10-05T13:00 in CDISC IS8601 format. This is the format. You want to convert this into a numeric format. Please confirm in which format you want to convert this date. So we could suggest.
Thanks,
Jag
Occasional Contributor
Posts: 9

Re: Date isue

Posted in reply to Jagadishkatam

Yes I want to convert it into numeric ,presently it in $20. format I want to present it in E8601DT19.

Trusted Advisor
Posts: 1,163

Re: Date isue

   data _null_; 
     length x $22 ; 
     x='2017-10-05T13:00'; 
     value=input(x,e8601dt19.); 
     put value=datetime19.;
run;
Thanks,
Jag
Super User
Posts: 10,574

Re: Date isue

Use the E8601 informat

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 5 replies
  • 195 views
  • 0 likes
  • 4 in conversation