BookmarkSubscribeRSS Feed
Inp
Obsidian | Level 7 Inp
Obsidian | Level 7

Hi Dear,

     When I ran the below attached coding, i was able to create a excel report, but i see a blank row is  being creted between the column header and the result, produced by Line statment..  How do I make to disappear / remove the blank row.


Thanks very much for your help in advance.

thanks

Anton

data test;
input @1 var1 $1. @2 Var2 $2.;
cards;
ab
cb
cd
ex
;
run;

ODS TAGSETS.EXCELXP  FILE='C:\TEMP\TEST.XLS'  STYLE=DEFAULT RS=NONE;


ODS TAGSETS.EXCELXP OPTIONS(
            ORIENTATION='LANDSCAPE'
        EMBEDDED_TITLES='YES'
             SHEET_NAME="SHEETXX"
                FITTOPAGE='YES

      CENTER_HORIZONTAL='ON'
  ABSOLUTE_COLUMN_WIDTH='08,08'
  );
RUN;
TITLE ' HOW TO REMOVE THE BLANK LINE AFTER THE COLUMN HEADER';
proc report data=test nowd ;

compute before;
line 'test';
endcomp;

run;
ODS _ALL_ CLOSE;
ODS LISTING;
RUN;

5 REPLIES 5
Cynthia_sas
SAS Super FREQ

Hi:

  I suggest that you use DOC='HELP' as a suboption and look for the description of the "skip_space" suboption. The space that you see is NOT attached to the column headers (I call the column headers the variable names in the columns). What you are calling the headers seems to me to be the area underneath the SAS title statement. The extra space after the SAS TITLE is controllable by TAGSETS.EXCELXP. But I think you need to use SKIP_SPACE='1,0,0,1,1' or something like that. I believe that the 3rd value is the amount of space to skip after the title.

  So if you did this: SKIP_SPACE='1,0,5,1,1' you would get a very tall cell underneath the SAS title.

cynthia

Inp
Obsidian | Level 7 Inp
Obsidian | Level 7

HI Cynthia,

Thanks very much for your response.

I am right, I didn't mean the blank row between the title and the table. I don't need the row ( 4th blank row) that is between the column header and the data.  I have tried many ways, but none of them works. If you can provide the solution for this , I will be much appriciated your help.

Thanks

Anton

Cynthia_sas
SAS Super FREQ

Hi:

I'm sorry, I only see the line that says "test" from the COMPUTE BEFORE code.

compute before;

   line 'test';

endcomp;

  The location that you describe is exactly the location where COMPUTE BEFORE LINE statement text would be written -- between the column headers and the first row of data. Did you want the COMPUTE BEFORE string???. Or, do you want to know how to change this location??? You might try COMPUTE BEFORE _PAGE_ and see if you like that location output better.

  Otherwise, take the COMPUTE BEFORE code block out of your PROC REPORT program. The SKIP_SPACE suboption is going to get rid of the blank space underneath the title. Taking out the COMPUTE BEFORE will eliminate the line that you describe.

cynthia

DoUKnowWhoIAm
Calcite | Level 5

Hi Cynthia,

I am jumping onto this discussion, because you mentioned the compute before _page_ block and I can't find anything on this topic relating to my problem.

I have created a seperate discussion for it.

I have two proc report statements.

The first generates a dummy table for subtotals.

Here I have a compute before _page_ block within ODS output. It adds one line containing a macro variable (username) and one blank line.

The second table is the data output and an autofilter is set.

It seems the compute block affects the autofilter such that it shifts to the first row of the data and is not on the column headings anymore.

Any thoughts ?

Regards

Reinhard

Cynthia_sas
SAS Super FREQ

Hi:

I posted some thoughts over in that other thread.

cynthia

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
  • 5 replies
  • 3786 views
  • 0 likes
  • 3 in conversation