12-08-2016 05:00 AM
Try and convert it to a numeric and check if it's not missing
You can use INPUT.
If input("¯ovariable", ?? Best12.) ne . Then put 'Numeric';
12-08-2016 05:50 AM - edited 12-08-2016 05:51 AM
Why use macro variables - which are only text - for numeric data in the first place? Remember Macro Language is only a text generation system, it does nothing on its own, that is what Base SAS is for. There is never a *need* to use macro.
That being said, if your developing a library tool with paramters, and you need to check it, then maybe something like:
... data _null_; call symput('TEST',ifc(lengthn(compress("&THEVAR."," .","d")) > 0,"Y","N")); run; %if "&test."="Y" %then... %put Failed; ...
Just to note, in the data _null_, you would do all your parameter checks, and then just output one result.
12-08-2016 06:11 AM
@Ksharp learned my new thing for the day
Need further help from the community? Please ask a new question.