Help using Base SAS procedures

export to multiple excel sheets based on variable

Reply
New Contributor
Posts: 3

export to multiple excel sheets based on variable

hi- i have a dataset "allproviders"

i would like to export the data in allproviders to multiple tabs based on change in "providername".  So for every group of "providername" i would like a new excel worksheet.  I found this thread https://communities.sas.com/message/13594#13594, but not sure how to use the code.  Can someone help me with code using my dataset names so that I can undestand it? I am completely new to SAS programmaing.

Thank you kindly

SAS Super FREQ
Posts: 8,866

Re: export to multiple excel sheets based on variable

Posted in reply to felicity1212

Hi:

  I just posted a simple example to your other forum posting. I am teaching today and not on a computer where I can do downloads. However, SASHELP.CLASS has 19 observations and 5 variables. You should be able to run my code posted in your other forum post and figure out how to use your dataset name and variable names with my code.

https://communities.sas.com/message/130211#130211

But run the code first and see if you can figure out what's what. SASHELP.CLASS is the name of the dataset and AGE is the name of the BY variable. So if your variable is called PROVIDERNAME or PROVNAME, then where I have BY AGE, you would have BY PROVNAME or BY PROVIDERNAME in your code.

Then where I have a VAR statement, you would use your other variables instead of NAME, AGE, SEX, HEIGHT and WEIGHT.

cynthia

New Contributor
Posts: 3

Re: export to multiple excel sheets based on variable

Posted in reply to Cynthia_sas

thank you cynthia!

Ask a Question
Discussion stats
  • 2 replies
  • 960 views
  • 1 like
  • 2 in conversation