The SAS Output Delivery System and reporting techniques

across variable in proc report

Reply
N/A
Posts: 0

across variable in proc report

Hello
I have a question : when my variable mean1 is numeric, there is not any problem and the reporting is OK :

ods rtf file="myway.rtf" startpage=yes;

proc report data=statdes split="~" Headline Headskip nowd;
column time group,( mean1 );
define time /group id ;
define group /across ;
run;

ods rtf close;

but if the variable mean1 is character, the following error message appears in log :
ERROR: There is no statistic associated with mean1.

so how can i solve this problem ?
Do you have any ideas ?
Thank you for your help and devices.
N/A
Posts: 0

Re: across variable in proc report

Hello,
Looking on syntax in column statement, I suppose you want to sum mean1 for each value of group.
N/A
Posts: 0

Re: across variable in proc report

No, vasile, want i want to do is only to easily displayed my datas when my variabme mean1 is character
to quote an example this a dataset :

data statdes_;
do time=1 to 5;
group= "A"; value="276.20±6.56(N=10)";
output;
group= "B"; value="322.35±1.28(N=12)";
output;
group= "C"; value="441.26±8.53(N=8)";
output;
group= "D"; value="282.20±4.11(N=11)";
output;
end;
run;
and i want to display only with a proc report my datas for time in the first column and the character variable value for the 4 differents groups, so my question is that it's ok if my variable value is numeric but if my variable value is character as shown in this example, i try to find a way to display the datas so may be there is an option that i don't know ? or another way to obtain what i want..?
thank you for your help. :-)

ods rtf file="myway.rtf" startpage=yes;

proc report data=statdes split="~" Headline Headskip nowd;
column time group,( value );
define time /group id ;
define group /across ;
run;

ods rtf close;
N/A
Posts: 1

Re: across variable in proc report

Montpe,

This may be a month too late, but try this:

data statdes_;
do time=1 to 5;
group= "A"; value="276.20±6.56(N=10)"; dummy=1;
output;
group= "B"; value="322.35±1.28(N=12)"; dummy=1;
output;
group= "C"; value="441.26±8.53(N=8)"; dummy=1;
output;
group= "D"; value="282.20±4.11(N=11)"; dummy=1;
output;
end;
run;

proc report data=statdes_ split="~" Headline Headskip nowd;
column time group,( value dummy);
define time /group id ;
define group /across ;
define dummy / analysis noprint;
run;

-David
SAS Super FREQ
Posts: 8,739

Re: across variable in proc report

Hi:
In the PROC REPORT doc on the DEFINE statement, there is a section called "Interactions of Usage and Position" or "Interactions of Position and Usage" that has a table showing which how different types of variables work together (Across, Display, Order, etc)....
I'm pretty sure there's a note there about having DISPLAY variables with ACROSS (when you define MEAN1 as a character variable -- it's essentially a DISPLAY variable), then I believe that's the situation you're in. Generally, an ACROSS report is a summary report and it's very hard to summarize a character variable.

cynthia
N/A
Posts: 0

Re: across variable in proc report

Thanks for clarification.
N/A
Posts: 0

Re: across variable in proc report

thank you cynthia for your answer, but in fact what i want to do is not to summarize a character variable but only to display it using an across variable.
N/A
Posts: 0

Re: across variable in proc report/display, across, group

SAS Super FREQ
Posts: 8,739

Re: across variable in proc report/display, across, group

Hi:
In particular, look at this note at the bottom of the table on page 936:

*When a display variable and an across variable share a column, the report must also contain another variable that is
not in the same column.


cynthia
N/A
Posts: 0

Re: across variable in proc report

thank you dschmeid (your name is not really easy to write :-) )
Ask a Question
Discussion stats
  • 9 replies
  • 607 views
  • 0 likes
  • 3 in conversation