Date: Fri, 19 Sep 2008 08:26:12 -0700
Reply-To: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Subject: Re: Printing exact number of variables
In-Reply-To: A<OF2C1DBD2B.19B0DBF5-ON862574C9.004FF7F7-862574C9.0051B5C0@fd9ns01.okladot.state.ok.us>
Content-Type: text/plain; charset="us-ascii"
Hi,
Somebody who has had their morning coffee
may have a fancier solution but here is
one approach:
* sample data ;
data a;
bidder1=1; bidder2=.; bidder3=1;
bidder4=.; bidder5=1; bidder6=1;
output;
bidder1=2; bidder2=.; bidder3=2;
bidder4=.; bidder5=2; bidder6=2;
output;
run;
proc transpose data=a out=b;
run;
data c;
set b;
if col1 eq . then delete;
run;
proc transpose data=c out=d;
run;
proc print data=d;
var bidder:;
run;
Hope this is helpful.
Mark Terjeson
Senior Programmer Analyst
Investment Management & Research
Russell Investments
253-439-2367
Russell
Global Leaders in Multi-Manager Investing
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Masoud Pajoh
Sent: Friday, September 19, 2008 7:54 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Printing exact number of variables
I have data set a that can have up to 10 vars called bidder1, bidder2 .
.
etc.
When any of these variables have value for one observation they have
values for all observations.
This data set is produced on the fly, i.e I do not know how many bidders
exist ahead of time.
This code:
proc print data=a;
var bidder:;
run;
Prints 10 even if some of them are completely blank.
Now, is there a way to determine and print only those that have
non-missing values?