Hello, I'm struggling with converting a string to a timestamp. This is quite easy in normal Datastep, but not for me in DS2. How would I have to modify the DS2 code so that I get the same result as in the normal datastep, CreationDate_n field. Many thanks for your help!
CreationDate_c length= $40
CreationDate_n length= 8 format=DATETIME25.6;
dcl timestamp CreationDate having format DATETIME25.6;
CreationDate= inputn(CreationDate_c,'ANYDTDTM.') ;
dcl date ds2d having format YYMMDD10.;
dcl time ds2t having format TIME18.9;
dcl timestamp ds2dt having format DATETIME28.9;
dcl double d t ts;
d = 19358;
ds2d = to_date(d);
ds2t = to_time(d);
ds2dt = to_timestamp(d);
put ds2d= ds2t= ds2dt=;
This doesn't solve the issue for converting the datetime string though. Sorry.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.