%macro verif_num_char_date(MyVar) / store;
var=input("&MyVar" ,?? COMMA8.);
IF var ne . then call symput('type','NUM');
if var ne . then call symput('type','DAT');
else call symput('type','CHAR');
I have the following Error message :
NOTE: Generated line by the macro variable "MYVAROUT".
It's best to start with a more basic DATA step execution to exercise your DATA step (and / or PROC steps too) logic. Then look at how you can inject macro language constructs for more flexibility.
Firstly, I see a DATA _NULL_ statement followed directly by an assignment that uses the INPUT function, however there would be no variable value assigned. I suspect that you thought that you could use a mix of SYMPUT and SYMGET within the same DATA step, then inserted the DATA _NULL_ when it didn't work for you.
Basically there are fundamental issues with your technique - one that attempts to mix macro language (a compilation time event) and DATA step processing.
As said above, many problems with your code.
You need to get up to speed with the macro language, and might want to consider proper training.
In this case, think of the macro language as a code generator.
This will work:
%Macro TestsFormat(MyVarIn, MyType, MyValueOk, MyValueNok, MyVarOut);
VAR=input(&MyVarIn ,?? COMMA8.);
if VAR ne . then TYPE='NUM';
TYPE=ifc( VAR ne . , 'DAT', 'CHAR');
&MyVarOut=ifc(TYPE = &MyType, &MyValueOk, &MyValueNok);
%TestsFormat(AGEC, 'NUM', '1','3', code_);
Note that a date like 20091231 will end up as NUM here.