03-26-2016 03:41 AM
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.
03-26-2016 04:32 AM
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.;
04-01-2016 04:16 AM
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.