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;
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:
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
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
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.
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:
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
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.
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.