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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.