BookmarkSubscribeRSS Feed
kuridisanjeev
Quartz | Level 8

Hi All..

I am using bellow Proc Tabulate code to produce one table with Admit dataset in SASUSER lib..

Proc tabulate data=t missing out=iytytyt;

class  sex actlevel;

var fee;

table  Fee = 'Fee' *

(n = 'n' * f = 8.

mean = 'Mean' * f = 5.1

std = 'Standard Deviation' * f = 5.1

min = 'Min' * f = 3. Max = 'Max' * f = 3.)

Sex = 'Gender' *

(n='n' * f = 3. )

Actlevel = 'Actlevel' *

(n = 'n' * f = 3. colpctn = '%' * f = 4.1),

(actlevel = " ") (all = 'Overall');

run;

Please provide Proc Report code to get above  result..

Thanks & Regards..

Sanjeev.k

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

Hi:

  Can you provide some data or replicate your table using one of the SASHELP datasets? It's very hard to code an example without knowing the structure of the input data. Also, what is your destination of interest? ODS HTML, RTF, PDF? Also, can you explain why there needs to be a switch to PROC REPORT if you have working TABULATE code? Is there some additional processing that needs to be done in REPORT -- that might change the type of REPORT code that gets generated. Oh, and, also the purpose for the OUT= (what is the ultimate use for the output dataset)?

Also, you are crossing a CLASS variable (ACTLEVEL) with itself, which should cause a WARNING message like this. Can you explain why you want to cross the variables this way?

  

WARNING: A class variable is crossed with itself in the table statement at line ??.  This may cause unpredictable results.

 

cynthia

kuridisanjeev
Quartz | Level 8

Hi Cynthia..

Thank you for your quick reply..

I have attached ADMIT dataset. and i am not that much familiar with Proc Tabulate.So i want to switch That code into Proc Report.

And i want to create listing output with RTF format and don't need output dataset as well..

Thnaks..

Sanjeev.K

Cynthia_sas
SAS Super FREQ

Sorry, I just looked at the TABLE statement. You crossed the ACTLEVEL variable with itself. That is not generally something that one does in a report. Not sure why you are doing that. What did you want to see on the last rows of the report?

Anyway, PROC REPORT will not derive statistics in the ROW dimension the way that  TABULATE does. TABULATE will do crossing (*) in all 3 dimension, PAGE, ROW and COL. But REPORT will only support crossing in the column area, with a usage of ACROSS.  Usually in a report like this, you would have pre-calculated the statistics - -probably with PROC MEANS or possibly with TABULATE or SQL. Generally, then you make columns something like this:

  COLUMN GRPORD ROWORD VARNAME STATNAME .....;

where you would have to assign some ordering variables to assure that the summarized numbers and statistics stayed in the order you wanted. Take a look at my paper called "Creating Complex Reports" -- especially at example 1, page 9 -- all the statistics had to be pre-calculated. (http://www2.sas.com/proceedings/forum2008/173-2008.pdf)

Also, if this is truly ADMISSIONS data, then it is possible that someone at your company has already created a report like this. Generally, when you work with clinical trial data, the same programs are re-tooled for each new study.

cynthia

kuridisanjeev
Quartz | Level 8

Thank you very much for your suggestions Cynthia..

Actually I am working with Some clinical report and input data is bit similar to Admit Dataset..Thats why i used Admit Dataset to create Sample report.

Any way i need some logic in Proc Tabulate and i will post those requirements in my next post..

Onece again thank you so much...

Thanks.

Sanjeev.K

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 1495 views
  • 0 likes
  • 2 in conversation