%macro test(Indate=,OUTDTC=); __&OUTDTC._INDAT = &Indate.; if vtype(__&OUTDTC._INDAT) = "C" then do; %let __INDAT_LEN=%sysfunc(length(__&OUTDTC._INDAT)); __&OUTDTC._INDAT1 = input(__&OUTDTC._INDAT,anydtdte&__INDAT_LEN..); end; else if vtype(__&OUTDTC._INDAT) ="N" then do; %if &Indate. ne . %then %do; __&OUTDTC._INDAT1 = &Indate.; %end; %else %do; __&OUTDTC._INDAT1 = .; %end; end; *ff=strip(upcase(&IS_INDATE_TYPE)); format __&OUTDTC._INDAT1 date9.; %mend; data hh; dt='2023-03-20'; ti='01:20:00't;output; dt='2022-04-22'; ti='12:45:00't;output; dt='10MAR2020'; ti='12:33:00't;output; format ti time.; run; data kk; set hh; %test(Indate=dt,OUTDTC=DTC1); run; When I run the above code getting "Character values have been converted to numeric values at the places given by: (Line):(Column)." But the date that I passed is character and why the else if condition is executing with numeric?
... View more