BookmarkSubscribeRSS Feed
CJamison
Calcite | Level 5

I have a computed column (PUTMONTHTEST) that is the basis for a prompt (Prompt_3) asking the user for the month (i.e. November) to use in a filter, but it results in a NOTE and and ERROR (see code). I've produced all code using GUIs and tried a number of things to resolve/understand what's going on but I need some help.

		 ;*';*";*/;quit;run;
		OPTIONS PAGENO=MIN;
		%LET Prompt_1 = DEPT1;
		%LET Prompt_10 = 3;
		%LET Prompt_11 = DEPT1;
		%LET Prompt_12 = DEPT2;
		%LET Prompt_13 = DEPT3;
		%LET Prompt_1_count = 3;
		%LET Prompt_3 = November;

	PROC SQL NOEXEC;
		SELECT 	t1.COLUMN_1,
                 	t1.COLUMN_2,
                 	t1.DATE_1,
                 	t1.PUTMONTH,
              FROM WORK.APPEND_TABLE_0000 t1
              WHERE %_eg_WhereParam( t1.COLUMN_1, Prompt_1, IN, TYPE=S, IS_EXPLICIT=0 ) AND %_eg_WhereParam(
                    t1.PUTMONTH, Prompt_3, IN, TYPE=S, IS_EXPLICIT=0 )
NOTE: Line generated by the macro function "UNQUOTE".
             "November"
                
ERROR 22-322: Syntax error, expecting one of the following: (, SELECT.  

ERROR 76-322: Syntax error, statement will be ignored.

  		ORDER BY t1.COLUMN_1;
	QUIT;

	%SYMDEL Prompt_1;
	%SYMDEL Prompt_10;
	%SYMDEL Prompt_11;
	%SYMDEL Prompt_12;
	%SYMDEL Prompt_13;
	%SYMDEL Prompt_1_count;
	%SYMDEL Prompt_3;
   
	QUIT; RUN;
2 REPLIES 2
CJamison
Calcite | Level 5

As a workaround, I figured out that if I change the "Number of values:" field, on the Prompt Type and Values tab of the Edit Prompt window, to "Multiple values", rather than "Single value", then I don't receive the syntax error. For my purposes this is an acceptable fix since I don't need to limit the user to a single value. However, why this error exists for "signal value" prompt types still needs to be resolved. 

CJamison_0-1637257167636.png

 

NataljaK
Obsidian | Level 7

Hi,

 

I see the error in the SQL

 

NataljaK_0-1637651414756.png

There must not be ',' after  t1.PUTMONTH

 

Kind regards

 

Natalja

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 751 views
  • 0 likes
  • 2 in conversation