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

I'm trying to replicate a report format, and I've got the data laid out in the order that I need, but I have an extra line that I'm trying to get rid of.  I have two proc report statments that I'm running on one tab of the spreadsheet.  This is made necessary by the requirement of a header row between sections of data.  I have used the sashelp.class table to illustrate what I am trying to do:

 

ods tagsets.ExcelXP file='c:\problem.xml'
                    options(embedded_titles='yes'
                            sheet_interval='none'
                            )
;

title1 "How Do I Remove The Extra Line?";
title2 "The line between the two procs";
run;
proc report data=sashelp.class(where=(sex='M'));
column name age height weight;
define name / display "Name";
define age / display "Age";
define height / display "Height";
define weight / display "Weight";
compute before;
 line "Males in the Class";
endcomp;
compute after;
 line "Females in the Class";
endcomp;
run;
title1;
title2;
run;
proc report data=sashelp.class(where=(sex='F')) noheader;
column name age height weight;
define name / display "Name";
define age / display "Age";
define height / display "Height";
define weight / display "Weight";
run;

ods tagsets.ExcelXP close;

 

After each of the procedure statements, as well as before the first procedure, after the title2 statement, there is a row that I would ideally like to remove automatically (rows 3, 17 and 27).  I know I could go into the spreadsheet and remove the row manually, but I am trying to remove any manual manipulation of this workbook.

 

Is there a way to do this programatically?

 

Capture.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Look into the SKIP_SPACE option in ODS TAGSETS.EXCELXP

 

http://support.sas.com/rnd/base/ods/odsmarkup/excelxp_help.html

 

The definition of the options is here:

 http://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#skip

 

 

The default values are:

  • Table : 1
  • Byline : 0
  • Title : 1
  • Footer : 1
  • PageBreak : 1

View solution in original post

2 REPLIES 2
Reeza
Super User

Look into the SKIP_SPACE option in ODS TAGSETS.EXCELXP

 

http://support.sas.com/rnd/base/ods/odsmarkup/excelxp_help.html

 

The definition of the options is here:

 http://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#skip

 

 

The default values are:

  • Table : 1
  • Byline : 0
  • Title : 1
  • Footer : 1
  • PageBreak : 1
chimanbj
Obsidian | Level 7

Thank you for that solution!

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
  • 2272 views
  • 0 likes
  • 2 in conversation