I am a SAS Developer. I currently have a script that will read from a table column that is in datetime format. In this script, it looks something like this:
data a; batch_dttm = '01Jan2011:00:00:00'dt; run;
proc sql; select batch_dttm format=16.0 into:batch_dttm from a; quit;
So when I assign it to macro variable, it is actually assigning the value of 2930485 into batch_dttm.
The problem is, when I want to resolve this &batch_dttm in another job at a later stage, i have to use this:
input(&batch_dttm,16.0)
to convert 2930485 into date.
I don't want to resolve in this way as this is the only Macro variable that has to be resolved with this input function. I want to assign 01Jan2011:00:00:00 (as text?) in PROC SQL INTO statement so that i dont have to use input conversion anymore.
I want to call &batch_dttm as datetime format in another script. I only want to resolve the datetime using "&BATCH_DTTM"dt instead of input(&batch_dttm,16.0). I believe there is a step to convert 01Jan2011:00:00:00 into text without changing it to 2930485. Is there anyway to do so?
How can I add 1 more step to make me resolve the macro in below script:
"&batch_dttm"dt