01-07-2017 07:22 PM
I am trying to use the set statement for multiple datasets in one shot namely I have datasets vmoreranked1,vmoreranked2,vmoreranked3,...But constantly getting an error
data stackorig; set vmoreranked1-vmoreranked&vmcnt; run; - 22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, ;, END, KEY, KEYS, NOBS, OPEN, POINT, DATA, LAST, NULL.
NOTE: The SAS System stopped processing this step because of errors.
Can someone help?
01-07-2017 08:46 PM
My guess: &VMCNT was created by PROC SQL and thus includes leading blanks. The easiest way to overcome this is to add this statement before the DATA step:
%let vmcnt = &vmcnt;
Alternatively (depending on how much subsequent processing has taken place), you might be able to use &SQLOBS instead of &VMCNT.
01-07-2017 09:52 PM