This will show how to Split SAS Output into multiple Sheets of excel. Change data set as per your data set name and break final output in your desired tab. For ex. my final output was 2104183 rows and I did split data in to 6 tabs because Excel tabs has limit of 100,000 rows for each tab. Split data in to 3 tabs DATA SNF_EXTRACT_1 SNF_EXTRACT_2 SNF_EXTRACT_3; SET work.SNF_EXTRACT_FINAL; if _n_ < 400001 then output SNF_EXTRACT_1; else if _n_ < 900001 then output SNF_EXTRACT_2; else output SNF_EXTRACT_3; RUN; Split data in to 4 tabs DATA PA_DATA_1 PA_DATA_2 PA_DATA_3 PA_DATA_4; SET work.PA_DATA; if _n_ < 700001 then output PA_DATA_1; else if _n_ < 800001 then output PA_DATA_2; else if _n_ < 900001 then output PA_DATA_3; else output PA_DATA_4; RUN; Split data in to 5 tabs DATA PA_DATA_1 PA_DATA_2 PA_DATA_3 PA_DATA_4 PA_DATA_5; SET work.PA_DATA; if _n_ < 800001 then output PA_DATA_1; else if _n_ < 1600001 then output PA_DATA_2; else if _n_ < 2400001 then output PA_DATA_3; else if _n_ < 3200001 then output PA_DATA_4; else output PA_DATA_5; RUN;
... View more