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
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
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
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;
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
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.