我似乎无法弄清楚为什么我的宏不会多次运行。我得到的错误是这样的:“在将来的SAS版本中,带引号的字符串后的标识符的含义可能会更改。建议在带引号的字符串和后续标识符之间插入空格”。我明白了...我在某处有一个混乱的报价..但我在任何地方都找不到。.请帮助。这是代码:
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; run; 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()=; run; proc sort data=t1; by &vars.; run ; proc transpose data=t1 out=t2(drop=_name_); by &vars.; var count; id year; run; proc summary data=t2 nway; var _numeric_; output out=t2sums(drop=_:) sum()=; run; 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; %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);