Help using Base SAS procedures

Proc report "Groups are not created..." warning

Reply
New Contributor
Posts: 4

Proc report "Groups are not created..." warning

Questions of this sort have been asked and answered many times, but I am not seeing the exact solution I need.

 

I have codes for institutions, and sites that are affiliated with those institutions.  A subset of the data follows:

instcodeafflcode
831
831
8313
8310
835
8311
8317
832
8314
731
731
7322
7317
7310
7316
7313

 

I want a report that lists the instcode, and the afflcode (among other things).

 

My code is :

 

proc report data=dset spanrows;
columns instcode afflcode;

define instcode/ 'inst' order=data group;
define afflcode/ 'affiliate' order=data;

compute after instcode;
line ' ';
endcomp;
run;

 

The output looks fine,

 

reportoutput.JPG

 

 

but I get the warning

"NOTE: Groups are not created because the usage of afflcode is DISPLAY. To avoid this note,
change all GROUP variables to ORDER variables."

 

If I change instcode to order, I get

"ERROR: You can only BREAK on GROUPing and ORDERing variables."

 

and the output definitely does not look right.

 

I don't want to ignore the error as I feel I am doing that at potential peril.

 

Any help anyone has would be greatly appreciated.

Occasional Contributor
Posts: 10

Re: Proc report "Groups are not created..." warning

Hi jtcowder,

 

Try:

 

data work.dset;
  input instcode $4. afflcode $2.  ;
  cards;
083	01
083	01
083	13
083	10
083	05
083	11
083	17
083	02
083	14
073	01
073	01
073	22
073	17
073	10
073	16
073	13
;
run;

proc sort data = work.dset out = work.dset_new;
by instcode afflcode;


proc report data=work.dset_new ;
	columns instcode afflcode;

	define instcode/ 'inst'  order order=internal;
	define afflcode/ 'affiliate';
run;

 

 

 

New Contributor
Posts: 4

Re: Proc report "Groups are not created..." warning

Thank you.

 

The "order" statement was what I was missing.

Once I put the "order order=data" in the message went away.

 

Thank you for your help.

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