DATA Step, Macro, Functions and more

Output individual tabs

Reply
Regular Contributor
Posts: 180

Output individual tabs

data have;

input state $ amt;

datalines;

 

AL 250

AL 500

CA 200

DE 1000

;

run;

proc sort = have out= have1; by state ;run;

proc print = have1 noobs;

by state;

run;

Lets say I want to proc export, I want each state to have its own tab without the byline so AL, CA and DE would output to its own tab.  I do not want to have to name each state because I may have to do this for all 50 states. 

Super User
Posts: 24,012

Re: Output individual tabs

proc sort data=sashelp.cars out=cars;
by origin;
run;

ods excel file='demo.xlsx' style=seaside
options(sheet_interval='bygroup' sheet_label='Origin');

title;
ods noptitle;

proc print data=cars noobs label;
by origin;
run;

ods excel close;
Ask a Question
Discussion stats
  • 1 reply
  • 99 views
  • 0 likes
  • 2 in conversation