You cannot run this code however I have general question
data Month_END_01;
set Month_End_END_1;
as_of_date = put(as_of_date,datetime.);
run;
The data is supposed to display a datetime in a field called as_of_date. Instead it displays a series of characters *** I tried converting using as_of_date = put(as_of_date,datetime.); however it simply converts it to a numeric with no data at all. Is there a solution? I cannot replicate this so I cannot display a code example
Are there ERRORs or WARNINGs in the log? If yes, what is the exact word-for-word message?
What does PROC CONTENTS say the data type (numeric or character) is variable AS_OF_DATE in data set Month_end_END_1? What does PROC CONTENTS say the format is for variable AS_OF_DATE in data set Month_end_END_1? What is the exact appearance of the values of this variable in data set Month_End_END_1?
What happens if you try this?
as_of_date1 = put(as_of_date,datetime.);
Lastly, @Q1983, I asked you many of these questions in your earlier thread, and no answer was provided. Please provide the answers. We can't help you without answers.
You cannot convert into the same named variable.
What is the original type and format of the variable as_of_date?
E.g. Character format=$10 or Numeric format=Datetime22.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.