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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 28266 views
  • 0 likes
  • 13 in conversation