BookmarkSubscribeRSS Feed
sai99
Calcite | Level 5

Error for attached program when running in UNIX:

 

NOTE: Line generated by the invoked macro "LOADCPDFIX".
19020 data _null_; set cpdvars; where (CPDCOBRS_GRP_T=&fixcpd and CPDCOBRS_VAR_NM=&var_nm); call
_______________
22
76
19020 ! symput('return_value',CPDCOBRS_RTRN_VLU_1); run;
ERROR: Syntax error while parsing WHERE clause.

ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, /, <, <=, <>, =, >, >=, AND, EQ, GE, GT,
LE, LT, NE, OR, ^=, |, ||, ~=.

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

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.00 seconds

6 REPLIES 6
Reeza
Super User

I don't see anything jumpling out at me...not that there isn't anything, but why are you doing this:

 

%let fixcpd=&Grouping_Criteria;
%let var_nm=&Var_name;
%let return_value=;

That doesn't add a lot of value to your code, except making it harder to trace and debug.

 

It may help if you include the full log - we can't run the code because we don't have the data. Maybe it's a data issue.

 


@sai99 wrote:

Error for attached program when running in UNIX:

 

NOTE: Line generated by the invoked macro "LOADCPDFIX".
19020 data _null_; set cpdvars; where (CPDCOBRS_GRP_T=&fixcpd and CPDCOBRS_VAR_NM=&var_nm); call
_______________
22
76
19020 ! symput('return_value',CPDCOBRS_RTRN_VLU_1); run;
ERROR: Syntax error while parsing WHERE clause.

ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, /, <, <=, <>, =, >, >=, AND, EQ, GE, GT,
LE, LT, NE, OR, ^=, |, ||, ~=.

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

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.00 seconds


 

sai99
Calcite | Level 5
I want to globalize sfixs, pfixs and suffixs but I am trying to avoid using local parametrs as global variables so used different variable names
Reeza
Super User

That explains the last part, but not why the first ones are renamed. You're also using them inconsistently, in some places you've used var_name and in some var_nm.  Not sure if that's intentional or not. 

 

This method was historically used to trim spaces, but there are other, better ways to do this now. 

 


@sai99 wrote:
I want to globalize sfixs, pfixs and suffixs but I am trying to avoid using local parametrs as global variables so used different variable names

 

Reeza
Super User

Does the non macro version work as expected?

 

	data _null_;
    set cpdvars;
	where (CPDCOBRS_GRP_T='CTL_log_sfix'
		and CPDCOBRS_VAR_NM=19);
	call symputx('return_value',CPDCOBRS_RTRN_VLU_1);
	run; 
sai99
Calcite | Level 5
yes data _null_;
set cpdvars;
where (CPDCOBRS_GRP_T=19
and CPDCOBRS_VAR_NM='CTL_log_sfix');
call symputx('return_value',CPDCOBRS_RTRN_VLU_1);
run;

works fine
Reeza
Super User

Then you need to post your full log. 

 


@sai99 wrote:
yes data _null_;
set cpdvars;
where (CPDCOBRS_GRP_T=19
and CPDCOBRS_VAR_NM='CTL_log_sfix');
call symputx('return_value',CPDCOBRS_RTRN_VLU_1);
run;

works fine



sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 916 views
  • 0 likes
  • 2 in conversation