BookmarkSubscribeRSS Feed
Nidhi_k
Calcite | Level 5

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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 15 replies
  • 28424 views
  • 0 likes
  • 13 in conversation