BookmarkSubscribeRSS Feed
IvanCh
Calcite | Level 5

Hi, everyone. Could help me with my output?

i should insert blank lines to separate horizontal borders.

this is my code:

ods pdf style=sasdocprinter file="/home/u35846133/outputs/test1.pdf";

proc report data=sashelp.cars nowd spanrows;
	column make model type MSRP invoice;
	define make /group;
	define model /display;
	define type /display;
	define MSRP /display;
	define invoice /display;
	
compute before make;
	line " ";
endcomp;
run;

ods pdf close;
3 REPLIES 3
Cynthia_sas
Diamond | Level 26

Hi:

  Using the sasdocprinter style as you show, this is what I see in the header area:

Cynthia_sas_0-1601384588705.png

 

It appears that there is space before each new group based on MAKE because of your COMPUTE BEFORE MAKE block. Isn't this what you wanted? It seems to me that the horizontal lines above and below the column headers are separated by the headers themselves. Would you want more space ABOVE the words for each header or UNDER the words for each header?

 

  Using a STYLE override, you can get more space in the header area as shown below (switched code to SASHELP.CLASS just because it's smaller and I already had the code and just had to switch the style):

Cynthia_sas_1-1601385284920.png

 

you can use the VJUST attribute to move the header to the top (VJUST=T) or the bottom (VJUST=B) of the header area. Use CELLHEIGHT to adjust the height of the header.

 

Cynthia

IvanCh
Calcite | Level 5

ouh, im so sorry. forgot to clarify. i need to insert blank lines into the body of document.

for example if i used "spanrows" i will have a blank line before the text only on the first page. but page 2 without a blank line.

IvanCh_0-1601387367519.pngIvanCh_1-1601387438447.png

It will be correct if there are blank lines (marked in yellow).

IvanCh_2-1601387721448.png

 

 

Cynthia_sas
Diamond | Level 26

Hi: The issue is that your group crosses over a page boundary. The COMPUTE BEFORE MAKE only executes on the first row of the new group. When the group crosses a page, that is not really the first row of the group. I understand that it IS the first row of the group on THAT physical page, but that is not how the COMPUTE block for a group item works. If you need to have a line inserted when the group crosses a page break then the easiest way is to put each group (in your example--each MAKE) on a separate page. Then, the page break would directly correspond to the group break for the COMPUTE block. However, if you want to control a scenario where there is a line inserted at this break, as you show on page 2, then you need to create a "helper" page breaking variable. This is going to entail figuring out how many rows will fit on one page and switching your COMPUTE BEFORE MAKE to a COMPUTE BEFORE HELPERVAR, where the HELPERVAR is actually your control for how many lines to put on a page. There have been several previous postings that show this technique and I think that there are some Tech Support notes too.
Hope this helps,
Cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1454 views
  • 2 likes
  • 2 in conversation