sas proc report

Occasional Contributor
Posts: 9

sas proc report

hi all

i am new to sas

i have been trying to create a report using this code but its not working properly

proc report data=work.test;

columns product state city;

define product /group;

define state /across

define city /across;


results come out as

                              california     new jersey       los angeles     trenton

product 1

whereas i want the output to look like this

                              california           new jersey

                              los angeles         trenton

product 1

any idea how i achieve that

i want the across one underneath the other so it looks like grouping and not one after the other

Super User
Posts: 13,583

Re: sas proc report

I don't do will with nesting in proc report which it looks like you may be doing. If the only thing you are looking for are simple counts and may have multiple cities per state then I would try proc tabulate:

proc tabulate data=work.test;

     class product, state, city;

     tables product, state*city*n=''*f=best8.;


Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation