|
The sample text file was attached to the message in my e-mail. I wonder
how that happened?
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Bian, Haikuo
Sent: Friday, July 29, 2011 11:28 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Questions about infile
It would be easier if your raw data can be input using column input:
The content of sample text file (shamelessly grabbed from SAS_L):
1001 M 1 23 24
1001 F 1 41 29
1001 M 2 34 15
1001 F 2 30 54
The code:
filename test "c:\temp\test.txt";
data want;
infile test;
input sex $ 10-10 @;
if sex='F';
input patid $ 1-4
day 16-16
aci 23-24
erm 28-29;
run;
proc print;run;
Doing so avoids reading in unwanted data. Since SAS_L does not allow
attachment, the sample text file will only be available to OP.
HTH,
Haikuo
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Fangfang Sun
Sent: Friday, July 29, 2011 9:56 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Questions about infile
Hello, everyone,
I need to read external raw data files to SAS using infile, but I donot
want to read in all raw data. For example, for SAS datesets, we have:
data a;
set b(where=(gender in ("F")));
Are there any statements or options, similar as "where", for infile?
Thanks!
Fangfang Sun
-----------------------------------------
Email messages cannot be guaranteed to be secure or error-free as
transmitted information can be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The Centers for Medicare
& Medicaid Services therefore does not accept liability for any error or
omissions in the contents of this message, which arise as a result of
email transmission.
CONFIDENTIALITY NOTICE: This communication, including any attachments,
may contain confidential information and is intended only for the
individual or entity to which it is addressed. Any review,
dissemination, or copying of this communication by anyone other than the
intended recipient is strictly prohibited. If you are not the intended
recipient, please contact the sender by reply email and delete and
destroy all copies of the original message.
************* IMPORTANT - PLEASE READ ********************
This e-mail, including attachments, may include confidential and/or proprietary information,
and may be used only by the person or entity to which it is addressed. If the reader of this
e-mail is not the intended recipient or his or her authorized agent, the reader is hereby
notified that any dissemination, distribution or copying of this e-mail is prohibited. If you
have received this e-mail in error, please notify the sender by replying to this message
and delete this e-mail immediately.
|