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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 630 views
  • 0 likes
  • 2 in conversation