Hi,
I'm having a tough time converting a couple of character variable fields into date fields. Each of the variables listed below are in the format of "2017-01-31" in character format. I tried to manually convert it but it's not working. Each of the _new variables I created only removed the "-" sign but still have blank spaces in them despite including the trim() function.
data new;
set raw;
Opened_dt_new = trim(tranwrd(opened_dt, "-", ""));
Maturity_dt_new = trim(tranwrd(maturity_dt, "-", ""));
Fico_dt_new = trim(tranwrd(fico_dt, "-", ""));
Expiration_dt_new = trim(tranwrd(expiration_dt, "-", ""));
drop opened_dt maturity_dt Fico_dt expiration_dt;
Opened_dt = input(Opened_dt_new, YYMMDD10.);
format Opened_dt YYMMDD10.;
Maturity_dt = input(Maturity_dt_new, YYMMDD10.);
format Maturity_dt YYMMDD10.;
Fico_dt = input(Fico_dt_new, YYMMDD10.);
format Fico_dt YYMMDD10.;
Expiration_dt = input(Expiration_dt_new, YYMMDD10.);
format Expiration_dt YYMMDD10.;
run;
Due to the fact that the _new variables have space in it, Format $YYMMDD was not found or could not be loaded. What is wrong here?
... View more