Hi everyone,
First, I would like to wish everyone Happy Easter and thank you for your help.
Now, the question: I have a dataset from insulin's pumpa when a patient measures blood suger at very different time periods. Thus, for a TIME variable I have a string which looks like this 2015-07-20 07:59.
I wonder how I can format this string to be able to work with time series?
Thank you in advance for any advice.
Regards,
Yuliya
You need to convert your string to a SAS date for starters, the INPUT function can do this. Depending on your data it may also be possible to change it earlier, ie if you are reading it from a text file its worth fixing it in that stage.
Date_var = input(string_var, anydtdtm.);
Format date_var datetime21.;
Hi Reeza,
thank you very much for your reply. Actually, I used your advice and change the format beforehand, now it is ok. But it is useful to know how INPUT works as well, I have never used it before, thank you.
Now I have other questions but I will post them under other title.
Have a nice day.
Regards,
Yuliya
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: