DATA Step, Macro, Functions and more

proc report dynamic measures

Reply
SAS Employee
Posts: 105

proc report dynamic measures

HI ,
I made simple proc report like this:

proc report DATA=M_HAIM.TRANSPOSE_REINSURANCE ;
column _NAME_ period,REINSURANCE_COMP , ( &measures );
define _NAME_ / order=data group 'measures' format=$M_H_row. ;
define PERIOD/ order=data across 'PERIOD' NOZERO format=M_H_COLUMN. ;
define REINSURANCE_COMP / across '';
define "0"n / sum format=comma12.2 'no- REINSURANCE_COMP' ;

define A / sum format=comma12.2 'A ';
define C / sum format=comma12.2 'C ';
define D / sum format=comma12.2 'D ';
define P / sum format=comma12.2 'P ';
define RR / sum format=comma12.2 'RR ';

rbreak after/summarize;
compute after ;
_NAME_='total';
endcomp;
run;

my problem is : the measures are dynamic .
in each run i can get more/less/different measures.

using dictionary.columns table l can bring all the columns into macro var,
and then use it in the column statment.
but i dont know what to do with the define statment.....

any suggestions?
Super Contributor
Super Contributor
Posts: 3,174

Re: proc report dynamic measures

With your situation, there are choices to make, depending on your SAS programming preference, as follows:

1) A macro can be used to reference your findings in DICTIONARY.COLUMNS and generate the SAS statements as required for your PROC REPORT execution, or

2) you can also use SAS DATA step logic (again using the output of COLUMNS) to do PUT commands to a "TEMP" FILENAME allocation and then %INCLUDE that temporary file inline with your PROC REPORT code.

The SAS support http://support.sas.com/ website has SAS-hosted documentation and also supplemental technical/conference papers on this type of topic. A SEARCH facility is available at the website, and also you can consider using something like a Google advanced search (like the argument below):

generate sas code using dictionary columns site:sas.com


Some of the results I found for your interest are listed below:


WHAT WOULD I DO WITHOUT PROC SQL AND THE MACRO LANGUAGE
Jeff Abolafia, Rho, Inc., Chapel Hill, NC
http://www2.sas.com/proceedings/sugi30/031-30.pdf

Using Metadata for Data Driven Programming
Brian Varney, Trilogy Consulting, Kalamazoo, Michigan
http://www2.sas.com/proceedings/sugi25/25/cc/25p077.pdf


Scott Barry
SBBWorks, Inc.
SAS Employee
Posts: 105

Re: proc report dynamic measures

OK,
THANKS ,
I WILL TRY TO DO OPTION NUMBER 2
Ask a Question
Discussion stats
  • 2 replies
  • 115 views
  • 0 likes
  • 2 in conversation