BookmarkSubscribeRSS Feed
BrianB4233
Obsidian | Level 7

I've been dipping my toes into the PROC REPORT world after having relied on PROC TABULATE to output some large demographic tables, especially with the additional customization that PROC REPORT offers. I have a dataset of around 6 thousand patients, and int his dataset is some common demographic characteristics: age group (3 categories), race_cat (4 categories), gender (binary), bmi_cat (4 categories), and a slew of comorbidity indicators (all binary), e.g., cancer, diabetes, chf, etc. Also within this dataset are some continuous measures that I output statistics for - age, length of stay, Charlson comorbidity score. And I'm outputting all of these by a binary indicator - tested (0,1). This will also contain a column that sums up the total going across. See attachment for sample dataset and PROC TABULATE code.

 

However, I've a lot of difficulty transitioning this to PROC REPORT, especially with multiple measures that (I believe) need to be defined as a group and where tested will be defined as the across measure. Any advice?

3 REPLIES 3
ballardw
Super User

You should show what you expect the output of the procedure to look like. Best would be to provide a small enough sample data set that you can manually make your report and then show us the values.

 

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.

 

The procedures Tabulate and Report do things differently and if you want multiple variables in a single column from Proc Report then you will likely need to do some reshaping of your data because that is not natural behavior for Proc Report.

ghosh
Barite | Level 11

Ì did not open your xlsx file however, I would suggest reading up on papers on this topic such as:

https://www.lexjansen.com/mwsug/2017/SA/MWSUG-2017-SA14.pdf

https://support.sas.com/resources/papers/proceedings/proceedings/sugi29/122-29.pdf

 

Furthermore, once you master proc report you will find its deficiencies and then it will be time to pick up RWI (report writing interface).  It complements Proc report and tabulate rather than replace them

Cynthia_sas
SAS Super FREQ

Hi:

  I did not open your Excel file -- it's more useful to have a DATA step program that creates your data, so I do not have to write a program to read the data.

 

  However, do any of your demographic reports look like Examples for #1 (page 9) , or Example #8 (page 17) in this paper: https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/173-2008.pdf ?? If so, I had to restructure the data and add some "helper" variables to produce the final output from PROC REPORT for #1 and DATA _NULL_ for #8.

 

  For challenges with ACROSS, this paper is useful: https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf and for working with COMPUTE blocks, this paper has some good tips: https://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf .

 

  After the spare elegance of TABULATE syntax, PROC REPORT can seem wordy and overly complicated to some folks. But the ability to customize the breaks, add lines and compute new columns directly in the REPORT syntax are things that you can't do with TABULATE. I don't know whether you need any of those things, since I can't visualize your data from your description or what it is your desired report needs to look like.

 

  Hope the papers point you to more info about PROC REPORT.

Cynthia

 

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1064 views
  • 0 likes
  • 4 in conversation