SAS EG Version 4.3.010196 I'm currently running a macro that creates multiple outputs based on a given condition. I want to option to export each data set to the same workbook on it's own individual tab. For HIPPA reason I can't include any data, but regardless of the data set(s) created (Excluding files larger than 65,000 lines (xls) and 100++ (xlsx)) I still need to export each data set into its own worksheet in one workbook. Output will never exceed 65,000 lines or multiple sheets per book of 12. Help is greatly appreciated Signed New Jack... *** DESIGN MACRO ***; %macro Macro1(HHH); PROC SQL; CREATE TABLE WORK.Q1_&HHH AS SELECT t1.* FROM WORK.QUERY_1 t1 WHERE t1.Contract = "&HHH"; QUIT; DATA WORK.Q2_&HHH; SET WORK.Q1_&HHH; IF Enrollment = . THEN Enrollment = 0; IF Enrollment1 = . THEN Enrollment1 = 0; RUN; PROC SQL; CREATE TABLE WORK.FINAL_&HHH AS SELECT t1.PRODUCT, t1.PlanType, t1.'Organization Name'n, t1.Contract, t1.'EG or DP'n, t1.PBP, t1.'Plan Name'n, t1.Service_Area, t1.County, t1.'Offers Part D'n, t1.Enrollment, t1.County1, t1.Enrollment1, (t1.Enrollment1 - t1.Enrollment) AS Change FROM WORK.Q2_&HHH t1; QUIT; PROC DATASETS LIB=WORK NOLIST; DELETE Q1_&HHH Q2_&HHH; RUN; %mend Macro1; *** RUN MACRO ***; %Macro1(H3359); %Macro1(H3330); %Macro1(H5549); %Macro1(H3328); %Macro1(H3361); %Macro1(H3347); %Macro1(H6181); %Macro1(H3312); %Macro1(H3370); %Macro1(H3307); %Macro1(H4866); %Macro1(H5991); %Macro1(H5528);
... View more