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-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!

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