Hi everyone
I have a column in my data set that is recognized by SAS as numeric and where the values are in the format of YYYY-MM-DD. I would like to convert it into YYYYMMDD format.
To do so I took the variable with the current format YYMMDD10 and create a new variable "date2" which is already numeric and in the format that I want it to be, YYMMDDN8. However, when I run the code, the "date2" stays empty.
Can you tell me how I can solve this?
I want to either a) transform the current date variable to YYMMDDN8 or b) create a new variable with YYMMDDN8 format.
Here is the code I used:
data xyz;
set xy;
date2= input(date, yymmdd10.);
format date2 YYMMDDN8.;
run;