Date: Fri, 19 Sep 2008 11:27:49 -0400
Reply-To: Jack Clark <jclark@HILLTOP.UMBC.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Clark <jclark@HILLTOP.UMBC.EDU>
Subject: Re: Printing exact number of variables
Content-Type: text/plain; charset="us-ascii"
You say " When any of these variables have value for one observation
they have values for all observations." Is the same true for missing
values? When any of these variables are missing one observation they are
missing values for all observations?
The solution below assumes that is correct and checks the first
observation of the data set for missing values in BIDDER1-BIDDER10.
* create sample data ;
infile cards missover;
input bidder1 $ bidder2 $ bidder3 $ bidder4 $ bidder5 $ bidder6 $
bidder7 $ bidder8 $ bidder9 $ bidder10 $;
AAA BBB CCC DDD
AAA BBB CCC DDD
AAA GGG HHH III
GGG LLL MMM PPP
* create macro variable with bidder variables that are non-missing ;
length bidlist $90.;
array bidder (10) $ bidder1-bidder10;
do i = 1 to 10;
if bidder(i) ne ' ' then bidlist =
proc print data = a;
University of Maryland, Baltimore County
Sondheim Hall, 3rd Floor
1000 Hilltop Circle
Baltimore, MD 21250
Confidentiality Notice: This e-mail may contain information that is legally privileged and that is intended only for the use of the addressee(s) named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying of this e-mail, distribution, or action taken in reliance on the contents of this e-mail and/or documents attributed to this e-mail is strictly prohibited. If you have received this information in error, please notify the sender immediately by phone and delete this entire e-mail. Thank you.-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Friday, September 19, 2008 10:54 AM
Subject: Printing exact number of variables
I have data set a that can have up to 10 vars called bidder1, bidder2 .
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.
proc print data=a;
Prints 10 even if some of them are completely blank.
Now, is there a way to determine and print only those that have