OPTION NOCENTER LS=MAX PS=MAX OBS=MAX MACROGEN; LIBNAME A '.'; OPTIONS FMTSEARCH=(A); /*附录宏*/ %MACRO M_APPENDIX_FORMAT(N1); %IF %INDEX(&LVARNAME,&N1.) %THEN %DO; %DO K=1 %TO &LA_LEN.; %LET AN=%SCAN(&LVARNAME.,&K.); %LET AC=%SCAN(&LA.,&K.); %IF &AN.=&N1. %THEN %DO; FORMAT &N1. $&AC._FMT.; %END; %END; %END; %ELSE %DO; FORMAT &N1. $3.; %END; %MEND;
%LET NL=%SYSFUNC(COUNTW(&NLIST.));/*变量个数*/ %LET LVARNAME=IDENTITEY_TYPE BUSINESS_ORG_TYPE BUSINESS_TYPE PAYBACK_PERSON_TYPE CLASS5_STATE CURRENCY PAYMENT_STAUTS;/*附录变量*/ %LET LA=A1 A18 A20 A44 A58 A32 A33;/*变量对应附录*/ %LET LA_LEN=%SYSFUNC(COUNTW(&LVARNAME.)); %M_APPENDIX_FORMAT(IDENTITEY_TYPE);