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

Hi,

 

I'm trying to suppress blank rows above and below a header created via an across statement in a proc report (SAS 9.2) . I'd like that the header contains the 2 solid lines (one above and one below) as the example below but with the blank rows deleted. Below the example and the corresponding SAS code I used.

 

Many thanks for your help,

Ingrid

 

Example :


TITLE_1

 

Region: Pacific
________________________________________________________________________________

                                                                                                                                                        TO BE DELETED

                                                                                       Kuala
                                    Auckland   Canberra   Jakarta   Lumpur        Manila       Singapore
                                                                                                                                                       TO BE DELETED
____________________________________________________________________________TO BE DELETED
Men's Casual                                $24,733    $373,908  $106,657 $128,309     $28,761

Men's Dress                $4,892       $4,231      $186,631 $55,667    $144,151    $30,619

Slipper                        $33,000      $44,121    $22,060   $83,212   $171,735     $36,612

Women's Casual        $18,189      $15,032    $18,761    $36,110    $131,794

Women's Dress          $42,760      $21,486    $4,659     $61,108     $229,372   $40,056

 

 


________________________________________________________________________________________________________
FOOTNOTE_1

 

SAS code:

 

proc sort data=sashelp.shoes out=shoes;
where region in ('Asia', 'Pacific', 'Canada');
by region product;
run;

data shoes2;
set shoes;
if product in ( "Boot" "Sandal" "Sport Shoe") then pagen = 1;
else pagen = 2;
run;

proc sort data=shoes2;
by region pagen product;
run;

 

proc report nowd data=shoes2 center headline spacing=0 split='|' ls=133 ps=48 missing formchar(1)="_" out=test;

column( '___' region pagen product Subsidiary ,Sales ) ;
define region / noprint '' order order=internal group ;
define pagen / noprint '' order order=internal group ;
define product / with =20 '' order order=internal group ;
define Subsidiary / width=25 '' group order=data across nozero center style(column)=[just=center];
define Sales / width=10 '' group center style(column)=[just=center] ;
break after product/ skip;
break after pagen/ page;

compute before _page_;
line @1 "TITLE_1";
line @1 " ";
line @1 "Region: " region $20.;
endcomp;

compute after _page_;
line @1 132*"_";
line @1 "FOOTNOTE_1 ";
endcomp;
run;

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Generally, I find that you do not need to create your own paging variable if you use regular by group processing. The blank line, you can get rid of. You did not specify your destination, so the screen shot below uses ODS HTML and STYLE=JOURNAL. You have some errors and/or inconsistencies in your code.

-- WITH= instead of WIDTH= also, this is a LISTING only option

--headline, spacing, ls, ps, formchar -- these are all LISTING only options and are all ignored by other ODS destinations

--order order=internal group as the usage -- you cannot have both ORDER and GROUP as usage. It seems you want GROUP, so use that with order=internal.

--several places you have style(column)=[just=center]; which is an ODS only option for HTML, RTF or PDF, so this is why your use of LISTING only options is inconsistent with using STYLE(COLUMN)

-- several places you write out your own lines to span the table -- if you just used STYLE=JOURNAL you would not need to do this.

 

cynthia

 

Here's a simplified version of your program using SASHELP.SHOES

use_by_group.png

View solution in original post

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

Hi:

  Generally, I find that you do not need to create your own paging variable if you use regular by group processing. The blank line, you can get rid of. You did not specify your destination, so the screen shot below uses ODS HTML and STYLE=JOURNAL. You have some errors and/or inconsistencies in your code.

-- WITH= instead of WIDTH= also, this is a LISTING only option

--headline, spacing, ls, ps, formchar -- these are all LISTING only options and are all ignored by other ODS destinations

--order order=internal group as the usage -- you cannot have both ORDER and GROUP as usage. It seems you want GROUP, so use that with order=internal.

--several places you have style(column)=[just=center]; which is an ODS only option for HTML, RTF or PDF, so this is why your use of LISTING only options is inconsistent with using STYLE(COLUMN)

-- several places you write out your own lines to span the table -- if you just used STYLE=JOURNAL you would not need to do this.

 

cynthia

 

Here's a simplified version of your program using SASHELP.SHOES

use_by_group.png

ingridb
Calcite | Level 5

Thanks a lot for the explanation and all these good tips.

A part of the issue was also coming from set up of destination file coding (code not shown in the example I've put above) .

Many thanks again for your help

Ingrid

Ksharp
Super User
I didn't see any blank lines after running your code ?

Try exchange the position of ACROSS variables.

column( '___' region pagen product Sales,Subsidiary ) ;


sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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