The SAS Output Delivery System and reporting techniques

ODS group header question

Reply
New Contributor
Posts: 2

ODS group header question

 

question: i use by variable to create the table and it automatically produce a "group header" in title, it in outside the table and at the "top" and center , well, is there any way to

put this group header on top left, not center? thanks

 

 

------------------------------------------------------------------------------------------------------------ 

proc report data=forl nowindows split="|" missing spanrows

 

style(header)={background=none}

style(report)={leftmargin=1 in outputwidth=100%};

by ZDTEST;

column USUBJID ZDTEST VISIT ZDTPT ;

 

 

define ZDTEST / "Test" width=8 group ;

define USUBJID /"Subject" width=10 flow group ;

define Visit / "Visit" width=8 group ;

define ZDTPT/"Time Points" width=10;

 

run;

 

OPTIONS CENTER NODATE NONUMBER ORIENTATION=landscape CENTER LEFTMARGIN="1 IN" RIGHTMARGIN="1 IN" TOPMARGIN="1 IN" BOTTOMMARGIN="1 IN" ;

ODS RTF file= "&OUTL.\Listing.RTF" style=Styles.journal /*bodytitle*/;

 

 

ods rtf close;

SAS Super FREQ
Posts: 9,433

Re: ODS group header question

Hi:

  It depends. You didn't show all your code and you didn't show WHAT the group header is or how it get there. Right now, based on the code you've provided, you don't have any TITLE statements or "group headers" -- and since you did not provide any test data nobody can run your code without making some test data and they can't make the test data because we don't know  how your group header is getting into the output. I suspect it is because of your BY statement, but I'm not sure. Are you seeing a standard BYLINE? For your ZDTEST variable?

 

  Here is a program using SASHELP.CLASS that shows how you can left justify a title and move BY group information into the title.

proc sort data=sashelp.class out=class;
by age;
where age le 13;
run;

ods rtf file='c:\temp\showby_vs_title.rtf' style=journal bodytitle;
proc report data=class spanrows
  style(report)={width=100%};
by age;
column age name sex height weight;
title '1) default byline is centered underneath title';
define age / group;
run;

options nobyline;
proc report data=class spanrows
  style(report)={width=100%};
by age;
title j=l '2) By Info is inside title for Age: #byval1';
column age name sex height weight;
define age / group;
run;

ods rtf close;
options byline;
title;

(BTW, options like FLOW and WIDTH are ignored by ODS destinations. They are LISTING only options which is why I did not put them in my code.)

 

Hope this helps,

Cynthia

New Contributor
Posts: 2

Re: ODS group header question

Posted in reply to Cynthia_sas

hi, Cynthia,

 

thanks a lot for help me. I run the code, what i want is move age=11 to left, not center. I don't know where should I just that in your code. thanks a lot.

 

 

 

 

 

test.jpg

SAS Super FREQ
Posts: 9,433

Re: ODS group header question

Hi: You should have a document with 6 pages. Pages 1, 2 and 3 are for Report with title 1); pages 4, 5, 6 show a left justified title with TITLE 2) as shown here:

word_left_justify_title.png

Look for the PROC REPORT code that has 2 in the title -- that shows j=l in the TITLE statement. You should see the change on pages 4, 5 and 6.

 

cynthia

Ask a Question
Discussion stats
  • 3 replies
  • 100 views
  • 0 likes
  • 2 in conversation