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

 

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

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

View solution in original post

3 REPLIES 3
Cynthia_sas
Diamond | Level 26

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

magicdj
Obsidian | Level 7

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

Cynthia_sas
Diamond | Level 26

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

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
  • 1440 views
  • 0 likes
  • 2 in conversation