BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
NewSASPerson
Quartz | Level 8

I am trying to use #byval to split by data into multiple worksheets... it works fine except there's a '2' tagged along with each sheet name except for the first sheet. The first sheet is fine.

e.g Sheet1 = 'ALL',

Sheet2='Gucci 2'

Sheer3 = 'Jimmy Choo 2'

Sheet4 = 'Prada 2'

Sheet5 = 'Valentino 2'

I can't seem to figure out what the issue is. Please see my code below. Any insight would be helpful.!

Also, is it possible for me to align my title to the left, I tried using the tagsets options merge_titles_footnotes='no' but that doesn't seem to work?

Thanks in advance!

/*code*/

proc sort data=designer_shoes_Sales out=designersales;

  by brand;

run;

ods _all_ close;

ods tagsets.excelxp

  file= "/servloc/myfolder/designer_Sales.xls"

  options (

  autofit_height = 'yes'

  row_repeat = '5'

  Wraptext = 'no'

merge_titles_footnotes='no'

  frozen_headers = '5'

embedded_titles= 'yes'

  Orientation = 'landscape'

  sheet_interval = 'bygroup'

  suppress_bylines = 'yes'

  sheet_name='#byval(brand)');

PROC report data=designersales;

  Title1 "Sales Report";

  Title2  "January - October 2010"

  Title3 "Designer Name: #byval(brand)";

  by brand;

  define Total/ format=comma9.;

  ;

run;

ods _all_ close;

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Change your options to remove sheet_name and add in sheet_label instead, with a blank space between the quotes.

  options (

  autofit_height = 'yes'

  row_repeat = '5'

Wraptext = 'no'

  merge_titles_footnotes='no'

  frozen_headers = '5'

embedded_titles= 'yes'

  Orientation = 'landscape'

  sheet_interval = 'bygroup'

  suppress_bylines = 'yes'

  sheet_label=' '

  );

Here's a good reference on finding the different options in tagsets:

http://www.sas.com/events/cm/867226/ExcelXPPaperIndex.pdf

View solution in original post

2 REPLIES 2
Reeza
Super User

Change your options to remove sheet_name and add in sheet_label instead, with a blank space between the quotes.

  options (

  autofit_height = 'yes'

  row_repeat = '5'

Wraptext = 'no'

  merge_titles_footnotes='no'

  frozen_headers = '5'

embedded_titles= 'yes'

  Orientation = 'landscape'

  sheet_interval = 'bygroup'

  suppress_bylines = 'yes'

  sheet_label=' '

  );

Here's a good reference on finding the different options in tagsets:

http://www.sas.com/events/cm/867226/ExcelXPPaperIndex.pdf

NewSASPerson
Quartz | Level 8

Perfect! Thank you so much, it worked!

I figured out the Title issue. These are the changes I made.

  Title1  j=left "Sales Report"

  Title2  j=left "January - October 2010"

  Title3 j=left "Designer Name: #byval(brand)";

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 2239 views
  • 1 like
  • 2 in conversation