This is my code so far: options mlogic mprint symbolgen spool NOQUOTELENMAX ; %macro schlub (num1=, num2=); data temp; test = %str(%') %do i = &num1. %to 9; %str("000&i.",) %end; %do i = 10 %to 99; %str("00&i.",) %end; %do i = 100 %to &num2.; %str("0&i.",) %end; %str(%') ; call symput("list", test); run; %mend schlub; %schlub(num1=0001, num2=0101); it produces this error: NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 1761:30 NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.TEMP may be incomplete. When this step was stopped there were 0 observations and 1 variables. WARNING: Data set WORK.TEMP was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 0.22 seconds cpu time 0.15 seconds It should more or less create this: data temp; test = ' "0001", "0002", "0003", "0004", "0005", "0006", "0007", "0008", "0009", "0010", "0011", "0012", "0013", "0014", "0015", "0016", "0017", "0018", "0019", "0020", "0021", "0022", "0023", "0024", "0025", "0026", "0027", "0028", "0029", "0030", "0031", "0032", "0033", "0034", "0035", "0036", "0037", "0038", "0039", "0040", "0041", "0042", "0043", "0044", "0045", "0046", "0047", "0048", "0049", "0050", "0051", "0052", "0053", "0054", "0055", "0056", "0057", "0058", "0059", "0060", "0061", "0062", "0063", "0064", "0065", "0066", "0067", "0068", "0069", "0070", "0071", "0072", "0073", "0074", "0075", "0076", "0077", "0078", "0079", "0080", "0081", "0082", "0083", "0084", "0085", "0086", "0087", "0088", "0089", "0090", "0091", "0092", "0093", "0094", "0095", "0096", "0097", "0098", "0099", "0100", "0101"'; call symput("list", test); run; I know I need to add a little logic to remove the comma at the last number, but I am trying to resolve this error first. Thanks, Paul
... View more