Hello,
I'm struggling a bit with the syntax.
I have a macro variable 'volume' whose value will change every day. And the outobs option needs to be equal to twice this volume. when I run without the outobs option, it runs fine. This is what I'm doing:
%let volume = 10;
proc sql outobs= 2*&volume.;
insert into abc
select acc, id, flag, ' ' as trial
from old_table where flag = 'n';
quit;
this is the error that I get:
ERROR 22-322: Syntax error, expecting one of the following: ;, CHECK, CODEGEN, CONSTDATETIME, DOUBLE, DQUOTE, ERRORSTOP, EXEC,
EXITCODE, FEEDBACK, FLOW, INOBS, IPASSTHRU, LOOPS, NOCHECK, NOCODEGEN, NOCONSTDATETIME, NODOUBLE, NOERRORSTOP,
NOEXEC, NOFEEDBACK, NOFLOW, NOIPASSTHRU, NONUMBER, NOPRINT, NOPROMPT, NOREMERGE, NOSORTMSG, NOSTIMER, NOSTOPONTRUNC,
NOTHREADS, NOWARNRECURS, NUMBER, OUTOBS, PRINT, PROMPT, REDUCEPUT, REDUCEPUTOBS, REDUCEPUTVALUES, REMERGE, SORTMSG,
SORTSEQ, STIMER, STOPONTRUNC, THREADS, UBUFSIZE, UNDO_POLICY, WARNRECURS.
ERROR 200-322: The symbol is not recognized and will be ignored.
Appreciate the help. Thanks!
Hi @AJ_Brien
You need this:
proc sql outobs= %eval(2*&volume);
insert into abc
select acc, id, flag, ' ' as trial
from old_table where flag = 'n';
quit;
Hi @AJ_Brien
You need this:
proc sql outobs= %eval(2*&volume);
insert into abc
select acc, id, flag, ' ' as trial
from old_table where flag = 'n';
quit;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.