Before making code flexible, make it run correctly.
Therefore eliminate all macro references; there is absolutely no sense engaging in macro programming when you haven't mastered basic SAS data step code yet.
If you want to flag single records on length, use this construct:
data want;
infile "name_of_file" length=lvar;
input
/* your variable list here */
;
if lvar > 46
then errorflag = 'Y';
else errorflag = 'N';
run;
... View more