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

Dear All,

 

I have one wired question noticed recent days.

Suppose I have a group variable with 3 levels(like 1, 2 and 3), when I do an analysis by use BY Group statement, in the past, I can get the information in the output with header : Group=1 xxx; Group=2 xxx; Group=3 xxx; But recent days I can't see this. I can all these results in the output are stacked. It is not convenient to decide which page to which page is the result for group 1, 2 and 3,  respecitvely, easily, do you know if there is an option that can control this ?

I use SAS 9.4 .

Thanks,

Jack.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

You might get this behavior if the BYLINE system option has been set to NOBYLINE.

It would be very simple to try:

 

options byline;

 

before the program and see if that fixes this.

View solution in original post

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

 

Sorry, you will need to clarify your question, show example test data in a datastep, and what the output should look like and what code you are running.  You can get group information in a title or such like by:

ods rtf file="....rtf";
proc print data=sashelp.class;
  by sex;
  title "Gender=#byval1";
run;
ods rtf close;
Jack2012
Obsidian | Level 7

Thanks for your advice. I will attached the shot in future. Not resolved.

Rick_SAS
SAS Super FREQ

What has recently changed about the data or the program? We might need a screenshot of the output or the program that gerneates the output.

 

Could there have been a change to the label of the BY variable? Compare the following analyses.  If the BY variable does not have a label, then the header is 

BYVAR_NAME=Level

but if a label exists you will get 

BYVAR_LABEL=Level

 

proc sort data=sashelp.cars out=cars;
by origin;
run;

title "Output when BY variable does not have a label";
proc means data=cars;
by origin;
var mpg:;
run;


title "Output when BY variable has a label";
proc means data=cars;
label origin="My Group";
by origin;
var mpg:;
run;

 

 

Jack2012
Obsidian | Level 7

Hi Rick,

 

I think it is due to the BYLINE options.

Now resolved.

 

Thanks.

Jack.

ballardw
Super User

You might get this behavior if the BYLINE system option has been set to NOBYLINE.

It would be very simple to try:

 

options byline;

 

before the program and see if that fixes this.

sas-innovate-2024.png

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.

 

Register now!

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.

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
  • 5 replies
  • 1149 views
  • 4 likes
  • 4 in conversation