- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am new to SAS and while I was learning I was using proc report for sashelp.class, and then fetching the output in an rtf format to see the output but in reality I got a simple tabular format and didn't get expected results.
Here's the code:
title "ABC school";
title2 "Students report";
footnote "This is a sample report.Don't rely on it";
ods rtf file="/home/u62925501/MyFolder/sample.rtf";
proc report data=sashelp.class (obs =10) nowd headline headskip split='*' out= ds1;
columns ("Student Class data"("Details" name sex) ("Measures" age height weight));
define sex/group;
break after sex/summarize;
run;
ods rtf close;
Here's the output coming in rtf file:
Expected output is:(note it is just a sample image)
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Your expectations are wrong. PROC REPORT gave you exactly what you asked for.
If you want something like the text output shown, you'd have to write code to get that, or perhaps use the %TABLEN macro.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
SAS ODA = SAS OnDemand for Academics (ODA).
For the rest ... , no clue what you are talking about ☹️.
Please elaborate !
Koen
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am new to SAS and while I was learning I was using proc report for sashelp.class, and then fetching the output in an rtf format to see the output but in reality I got a simple tabular format and didn't get expected results.
Here's the code:
title "ABC school";
title2 "Students report";
footnote "This is a sample report.Don't rely on it";
ods rtf file="/home/u62925501/MyFolder/sample.rtf";
proc report data=sashelp.class (obs =10) nowd headline headskip split='*' out= ds1;
columns ("Student Class data"("Details" name sex) ("Measures" age height weight));
define sex/group;
break after sex/summarize;
run;
ods rtf close;
Here's the output coming in rtf file:
Expected output is:(note it is just a sample image)
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello @v307086 , don't post the same question twice, and don't change the topic of a thread in the middle. Your PROC REPORT question should be discussed in your other thread at https://communities.sas.com/t5/SAS-Programming/proc-report-in-SAS-ODA/td-p/855012/jump-to/first-unre...
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Your screen shot of desired results is the type of report typically called a demographic report. There is not any SAS procedure that will generate that type of report for you by default. You have to do more manipulation of the summarized data in order to generate the type of report you show. For example, your XX (XX%) for the values for the Active vs the Placebo is usually the concatenation of 2 numeric variables (N and PCTN) in order to make a character string that can be displayed under each major column. Typically, to get the results for GENDER, you run PROC FREQ for each of your groups (ACTIVE/PLACEBO) and then for your AGE values, you run PROC MEANS. Generally, you need to post process the data from both of these procedures to get the data in a form that's ready for PROC REPORT. There are several macro programs floating around that do it. I have several examples using PROC REPORT with some helper variables in my Creating Complex Reports paper and Lisa Fine has some examples of this type of report in her book on using PROC REPORT and I'm sure I remember several PharmaSUG papers that had different ways to use PROC REPORT or the DATA step to generate this type of report.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In SAS Studio, you can call up any table to view it, and leave it viewable for as long as you want (in other words until you close it).
Step 1: Go to Libraries on the left.
Step 2: Expand "My Libraries".
Step 3: Expand the library of interest (often the WORK library).
Step 4: double-click on the data set of interest.
When you next run code, the data set you just opened remains open, however "My Libraries" collapses and you have to go through steps 2 through 4 again to get to that library. I do find this incredibly annoying and a major drawback of SAS Studio, making programming much more time consuming, but it is possible.
Paige Miller