- data code;
- input code $3. prod_des $20.;
- cards;
- M22 H&M (Shop)
- ;
- run;
- data _null_;
- set code;
- call symput (cat('code',_n_),strip(code));
- call symput (cat('gdesc',_n_),strip(prod_des));
- call symput ('numgenp', strip(put(_n_,12.))); /* by Jovi, NOTE: Numeric values have been converted to character values*/
- run;
- %macro macro_format;
- proc format;
- value $gencode
- %do i=1 %to &numgenp.;
- "&&code&i" = "&&gdesc&i"
- %end;
- other = "Unknown"
- ;
- %mend macro_format;
- %macro_format;
MPRINT(MACRO_FORMAT): proc format;
WARNING: Apparent symbolic reference M not resolved.
MPRINT(MACRO_FORMAT): value $gencode "M22" = "H&M (Shop)" other = "Unknown" ;
NOTE: Format $GENCODE is already on the library.
NOTE: Format $GENCODE has been output.
怎么样才可以不出桔黄色的Warning?试了各种%str,%nrstr,%nrbquote,不知道怎么正确使用才能不出warning。