BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AJ_Brien
Quartz | Level 8

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!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ErikLund_Jensen
Rhodochrosite | Level 12

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;

View solution in original post

2 REPLIES 2
ErikLund_Jensen
Rhodochrosite | Level 12

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;
AJ_Brien
Quartz | Level 8
that worked, thank you!
How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2524 views
  • 0 likes
  • 2 in conversation