BookmarkSubscribeRSS Feed
Rsadiq1
Calcite | Level 5

    Hello I am getting a syntax error that is not making sense to me, if anyone could help

 

ARNING: Apparent symbolic reference POL_NBR not resolved.
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant,
              a missing value, (, -, SELECT. 

 

 

WHERE UPCASE(C.POL_NBR) IN (&pol_nbr.)
               and ADR.ST_CD in (&statlst.)
               and (datepart(AC.CREAT_DTTM) >= input("&bak14.",mmddyy10.))
               and P.ENRL_DT~=.
               and P.PGM_CATGY_TYP_ID in ("04")
               and P.PGM_TYP_ID not in ("52","04")            
               and P.MBR_PGM_STS_RSN_TYP_ID = "81"
               and P.MBR_PGM_STS_TYP_ID = '05'
          ORDER BY M.MBR_ID
     ;
quit;

2 REPLIES 2
ballardw
Super User

Showing the entire code is better.

 

The warning says that at the time the macro processor attempts to evaluate this line:

UPCASE(C.POL_NBR) IN (&pol_nbr.)

no value has been assigned to the macro variable &pol_nbr.

 

The error follows because this comparison

where UPCASE(C.POL_NBR) IN ()

is invalid without at least one value inside the () after in.

kanivan51
Obsidian | Level 7
Hi! &pol_nbr. - is this a single value or not? If it is not - check for quotation and punctuation. Show us the code, please

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1430 views
  • 0 likes
  • 3 in conversation