Date: Mon, 16 Apr 2007 08:59:19 -0500
Reply-To: "Huang, JS" <Huang.JS@PRINCIPAL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Huang, JS" <Huang.JS@PRINCIPAL.COM>
Subject: Re: Empty columns
In-Reply-To: A<1176730786.112778.93640@l77g2000hsb.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"
You may want to try coding like the following:
array Num(*) _numeric_;
array Str(*) $ _character_;
do i=1 to dim(Num);
if Num(i) eq . then do;
...
end;
end;
do i=1 to dim(Str);
if Str(i) eq ' ' then do;
...
end;
end;
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
finiderir3@gmail.com
Sent: Monday, April 16, 2007 8:40 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Empty columns
Hi,
I am new here, and it is my first post on this newsgroup.
I am using :
SAS 9.1.3 Service Pack 3
XP_PRO plate-forme
My Goal :
I have a table with 400 columns and thousands lines.
I know some of the columns are empty.
I would like to write a SAS program which display anywhere the name of
the columns which are empty.
My problem :
The columns have not a similar name, for example the first is "year",
the second is "abcd" etc and I do not want to write a line for each
column like this [code] do obsnum=1 to 1 000 000;
if (year=".")
end;
[/code]
I know there is a way of typing only one time the name of the columns,
using an array, like this :
[code]
array cols{11} $200 STATE COUNTY PR_TYPE LAST_NM FIRST_NM
DEGREE TAX_ID ADDR CITY ZIP PHONE ;
[/code]
But Is there any other way, smarter than typing 400 columns names ?
PS : I am a french guy and I apologize for mistakes.
-----Message Disclaimer-----
This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to Connect@principal.com and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.
Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.
While this communication may be used to promote or market a transaction
or an idea that is discussed in the publication, it is intended to provide
general information about the subject matter covered and is provided with
the understanding that The Principal is not rendering legal, accounting,
or tax advice. It is not a marketed opinion and may not be used to avoid
penalties under the Internal Revenue Code. You should consult with
appropriate counsel or other advisors on all matters pertaining to legal,
tax, or accounting obligations and requirements.