The INFORMAT is incorrect, it needs to be the informat that matches how the data appears, basically it tells SAS how the variable appears and how it should be read in.
If your data shows as YYYY/MM/DD then it should be YYMMDD10.
Note that this was one of the same issues in your previous question.
data vchange2;
set work.vchange;
hbv2 = input(hepb_date, YYMMDD10.);
format hbv2 yymmdd.;
run;
@Cooksam13 wrote:
I am converting the date that shows up as yyyy/mm/dd in a character format to a numeric
this is what proc contents looks like for the original data
proc contents data = work.vchange;
run;
Variable Type Len Format Informat Label
HepB_DAte |
Char |
10 |
$10. |
$10. |
hepbdate |
and this is the code i am using to convert the data
data vchange2;
set work.vchange;
hbv2 = input(hepb_date, 10.);
format hbv2 yymmdd.;
run;
and the error that comes up is:
NOTE: Invalid argument to function INPUT at line 71 column 8.
HepB_DAte=2010/01/01
can someone help with this?
thanks