Macrovariable values have a maximum length of 65,534 characters, your 1500 accounts are using up all that space and there is no option to increase that size. Since you define the macro variables within the macro then they disappear when that macro is finished and you can't call them outside of the macro. Use the %global statement to define the macro. The ERROR message is an indicator, you have shown how you're calling the macro variables so we can't tell you if you have another error or not. Here some info on macro variable scope: http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001072111.htm#a001072130 Check the scope of your variables by using some %put statements inside your macro and outside. HTH %MACRO FORMAT_DATASET(LIB=,TABLE=); PROC DATASETS LIBRARY=&LIB; DELETE &TABLE; RUN; DATA &LIB..LISTFILE(DROP=ACCT_NBR); SET &LIB..&TABLE(KEEP=ACCT_NBR); FORMAT ACCT_NBR_MQ $QUOTE20. ACCT_NBR_DQ $QUOTE24.; ACCT_NBR_MQ=PUT(INPUT(ACCT_NBR,22.),Z18.); ACCT_NBR_DQ=PUT(INPUT(ACCT_NBR,22.),Z22.); RUN; PROC SQL; SELECT ACCT_NBR_DQ INTO :ACCT_NBR_DQ SEPARATED BY "," FROM &LIB..LISTFILE; SELECT ACCT_NBR_MQ INTO :ACCT_NBR_MQ SEPARATED BY "," FROM &LIB..LISTFILE; QUIT; %LET ACCT_NBR_D=%SYSFUNC(TRANWRD(%BQUOTE(&ACCT_NBR_DQ),%BQUOTE("),%BQUOTE('))); %LET ACCT_NBR_M=%SYSFUNC(TRANWRD(%BQUOTE(&ACCT_NBR_MQ),%BQUOTE("),%BQUOTE('))); %put &ACCT_NBR_D.; %put &ACCT_NBR_M.; %MEND FORMAT_DATASET; %put &ACCT_NBR_D.; %put &ACCT_NBR_M.;
... View more