DATA Step, Macro, Functions and more

Proc report help

Reply
Super Contributor
Posts: 272

Proc report help

Yesterday I posted this one. One of the support suggested me to look for examples. I didnot find similar one. Please help thanks.

 

What should I add to my code get output. Thank you.

 

code;

proc report data=one;
column code text ns100 ns200 ns300;
define code/order;
define text/order;
run;

 

data1

 

text                           NS\100                NS\200                             NS\300                  code

 

joint pains                    10                        20                                      30                      Rheumatic

knee pains                    5                          20                                     25                      Rheumatic 

vomiting                       3                           6                                       40                       GE

nausea                        30                          20                                    26                        GE

headche                       4                            5                                      22                       Cardiac

chest pain                     20                          20                                     30                       Cardicac

 

 

Output table needed;

 

term                           NS\100                NS\200                         NS\300 

_________________________________________________________________

Cardiac

   headche                        4                            5                                      22  

   chest pain                     20                          20                                     30

 

Rheumatic

    Joint pains                    10                        20                                      30

     knee pains                    5                          20                                     25

 

GE

    vomiting                       3                           6                                       40

    nausea                        30                          20                                    26

 

 

Super User
Posts: 11,343

Re: Proc report help

Posted in reply to knveraraju91

If you really want two different variables to appear in the same column that is a LOT of extra work especially if the row with the code value is not supposed to have any summary. Is it acceptable to have a summary for the code group?

 

And is the display order within the values of Text critical? Example would this be acceptable?

GE

    nausea                        

    vomiting          

 

Super Contributor
Posts: 272

Re: Proc report help

Thanks for your time. What you said is acceptable. Please provide the code(an example) I will try to get the output.

 

Thank you

SAS Super FREQ
Posts: 8,868

Re: Proc report help

[ Edited ]

Hi:
This is something you can accomplish with PROC REPORT. You would have to define CODE as an ORDER item with the NOPRINT option and then, in the column for TEXT, you would write the CODE value before the first value for TEXT. There's an example using SASHELP.SHOES below. If you have pre-summarized data, then the same technique will work with ORDER variables as well as GROUP variables.
cynthia

 

show_indent.png

Ask a Question
Discussion stats
  • 3 replies
  • 142 views
  • 2 likes
  • 3 in conversation