Date: Wed, 31 May 2006 13:55:30 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: is there a smater way to do it
In-Reply-To: <1149046026.621024.89640@h76g2000cwa.googlegroups.com>
Content-Type: text/plain; format=flowed
proccontents ,
I started to answer this post late last night and stopped myself. Besides
the macro design needing some work I am wondering why you are creating 50
data sets and why you are adding page breaks and row numbers.
Leyt me explain, right now you are breaking the data up by selecting what
you want. This can get rather unwieldy as your design shows. Why not do
the reverse and keep the data all together use a view to create a new var
that contains which group ot belongs too or if it is as simple as you have
shown use a format directly in proc format. Then use by group processing to
get the information out in data set. Now depending on how you plan on
reporting this information out will dictate whether you need to preprocess
the data or not, there are many ways to get more or less what you want with
out pre or post processing the data or proceessing it in this manner. since
I dont know how you plan on doing that I will refrain from commenting any
further.
Toby Dunn
From: "proccontents@gmail.com" <proccontents@GMAIL.COM>
Reply-To: "proccontents@gmail.com" <proccontents@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: is there a smater way to do it
Date: Tue, 30 May 2006 20:27:06 -0700
Hello guys I am doing this for a table, to get into a way a table I am
doing something like this
%macro freqout(ds_out = ,page_num = , row = );
data pi_test;
set pi_freq;
where &cond;
run;
proc freq data = pi_test noprint ;
tables var /list missing out = &ds_out(drop = PERCENT ) ;
run;
data &ds_out;
set &ds_out;
pagebrk = &page_num;
row = &row;
run;
%mend;
%let cond = affshld in('1','0') ;
%freqout(ds_out = pi_cond1, page_num = 1 , row = 2);
%let cond = (affshld = '2');
%freqout(ds_out = pi_cond2, page_num = 1 , row = 3);
..................
There are 50 conditions and I am generating I am 50 datasets and
planning to set them this way
data report_all;
set pi_cond1 pi_cond2 ...........................pi_cond50;
run;
I am looking for better way to do this , what I mean is smater way like
something using proc sql to do whole thing is smallest possible way .
thanks for your time and help