05-26-2016 09:33 PM
I am trying to concatenate some character variables and one of those variable is SYS date and time. SYS date and time should be YYYY-MM-DD:hh:mm:ss format. Can someone help me please. Thanks.
The code i am trying to write is like:
Long_char='1234'||'ABCD'||System date and Time;
05-26-2016 10:47 PM - edited 05-26-2016 10:48 PM
You can use datetime() function instead. My personal preference is to use the CATT function, I find it more readable.
%put %sysfunc(datetime(), datetime21.); data want; long_var = catt("1234", "ABCD", put(datetime(), datetime21.)); run; proc print data=want; run;
05-27-2016 11:28 AM
05-27-2016 11:30 AM - edited 05-27-2016 11:32 AM
Thank for your code, but I don't know how to put it in the data step. Would you please put your code in the following data step so that I can get my expected result. I never worked with a let statement. Thanks.
long_char='1234'||'ABCD'||SYS date and SYS time;
Need further help from the community? Please ask a new question.