|
PD,
If your text file is kept in primary key order (and your SAS dataset is
also in primary key order) try the following (untested) code:
data _null_;
infile bigfbtxt;
file myfbtxt;
set mysasdata(keep=primkey);
by primkey; /* not necessary */
keyfound = 0;
do while (keyfound = 0);
input @&keylocn keytext $16.;
if primkey = keytext then put _infile_;
keyfound = 1;
end;
run;
If your text file is NOT kept in primary key order, you could index your
SAS dataset and try the following (untested) code:
data _null_;
infile bigfbtxt;
file myfbtxt;
input @&keylocn primkey $16.;
set mysasdata(keep=primkey) key=primkey;
if _iorc_ = %sysrc(_sok) then put _infile_;
run;
HTH,
Dave
PD
<sophe88@YAHOO.CO To: SAS-L@LISTSERV.UGA.EDU
M> cc:
Sent by: "SAS(r) Subject: Cut a part out of a big flat fixed length text
Discussion" file
<SAS-L@LISTSERV.U
GA.EDU>
|---------------------|
| ( ) Urgent(4 hours) |
26/06/2003 14:00 | (*) Normal(24-48) |
Please respond to | ( ) Low(72 hours) |
PD |---------------------| Expires on
I have a big fixed length text file with about 2000 vars. The primary
key is a 16-character var. There are about 42 millions obs in the
file. It sits on a OS390 tape image. (can not browse it, but
reading/sharing is fine). I have another SAS dataset that has about
150k of this 16-charter var.
I need to preseve the layout of the text file, but only want to
records for the 150k people. I have the layout for the text file, but
do not want to write them into a SAS data set, afraid the layout may
not be preseved.
I used to run a JCL based Syncsort program that allows me to
match-merge two text files using a common key without transferring
them to SAS files. Recently the program is not functioning properly.
So I am resorting to SAS again.
Heard about CNTln option in proc format. Don't know how relevant that
is to my problem.
Thank you.
PD
Important: This e-mail is intended for the use of the addressee and may contain information that is confidential, commercially valuable or subject to legal or parliamentary privilege. If you are not the intended recipient you are notified that any review, re-transmission, disclosure, use or dissemination of this communication is strictly prohibited by several Commonwealth Acts of Parliament. If you have received this communication in error please notify the sender immediately and delete all copies of this transmission together with any attachments.
|