BookmarkSubscribeRSS Feed
yonib
SAS Employee
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?
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
yonib
SAS Employee
OK,
THANKS ,
I WILL TRY TO DO OPTION NUMBER 2

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 727 views
  • 0 likes
  • 2 in conversation