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

 can't seem to figure out why my macro will not run more than once. The error i am getting is something like: "The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space between a quoted string and the succeeding identifier is recommended". I get it... i have a messed up quote somewhere.. but i cannot find it anywhere.. please help. Here is code

 

proc datasets lib=work nolist kill; run; quit;
libname tw '';
libname jrd   '';
ods results = off;
options varinitchk=error;

proc sort data=tw.datset_name out=x0; by inquiry_id quote_time_dt quote_time;

data quotes; set x0; by inquiry_id quote_time_dt quote_time;
if first.inquiry_id;
year =year(quote_time_dt);
count =1;
run;

data transactions; set dataset_name;
year = year(execution_time_dt);
count = 1;run;

%let q1 = swap_product instr_desc;
%let q2 = package_type;
%let q3 = dealer;
%let q4 = recipient_company;

%let t1 = swap_product instr_desc;
%let t2 = on_sef;
%let t3 = package_ind package_type;
%let t4 = alloc_ind;
%let t5 = block_ind;
%let t6 = initiating_company;
%let t7 = dealer;
%let t8 = exec_platform;

%macro create(input, vars, output);
proc summary data=&input. nway; class &vars. year; var count;
output out=t1(drop=_:) sum()=;

proc sort data=t1; by &vars.;
proc transpose data=t1 out=t2(drop=_name_); by &vars.; var count; id year; 

proc summary data=t2 nway; var _numeric_;
output out=t2sums(drop=_:) sum()=;

data &output.; format &vars.; set t2 t2sums;
total = sum(of _numeric_);
array p _character_;
    do over p;
        if p = '' then p = 'Total';
    end;
run;
%mend; quit;

%create(quotes,&q1.,table1);
%create(quotes,&q2.,table2);
%create(quotes,&q3.,table3);
%create(quotes,&q4.,table4);

%create(trans,&t1.,table5);
%create(trans,&t2.,table6);
%create(trans,&t3.,table7);
%create(trans,&t4.,table8);
%create(trans,&t5.,table9);
%create(trans,&t6.,table10);
%create(trans,&t7.,table11;
%create(trans,&t8.,table12);
1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

@jdykstra wrote:

 can't seem to figure out why my macro will not run more than once. (...)

 

%create(trans,&t7.,table11);

(Closing parenthesis inserted.)

 

Unbalanced parentheses can also cause programs to "not run more than once." However, this doesn't explain the log message about "an identifier after a quoted string."

View solution in original post

7 REPLIES 7
data_null__
Jade | Level 19

Run it in BATCH or start a new SAS session and run it.  Also use MPRINT option so you can see then code where any errors, warning or notes are referring to.

Reeza
Super User
Not sure why your macro isn't working, but I think you could get better results using PROC MEANS with the STACKODS options and avoid having to reshape your data.
To help debug this, please run it with the MPRINT and SYMBOLGEN options enabled and post the log.
jdykstra
Calcite | Level 5

So i place "options symbolgen;" below the "options varinitchk=error" and i put "options mprint" after "%mend;"???

data_null__
Jade | Level 19

options varinitchk=error mprint=1 symbolgen=1;

 


Make it easy put them all at the top.  You don't really need symbolgen.

 

 

FreelanceReinh
Jade | Level 19

@jdykstra wrote:

 can't seem to figure out why my macro will not run more than once. (...)

 

%create(trans,&t7.,table11);

(Closing parenthesis inserted.)

 

Unbalanced parentheses can also cause programs to "not run more than once." However, this doesn't explain the log message about "an identifier after a quoted string."

novinosrin
Tourmaline | Level 20

Nice!! Hawk eye:)

jdykstra
Calcite | Level 5

Actually, this completely solved my issue.  I can't believe i didn't see that, tbh. I'm blind.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 7 replies
  • 1403 views
  • 2 likes
  • 5 in conversation