Date: Tue, 3 Jul 2001 15:22:03 -0400
Reply-To: Crystal Vierhout <vierhout@UNITY.NCSU.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Crystal Vierhout <vierhout@UNITY.NCSU.EDU>
Subject: Index with a key read
Content-Type: multipart/alternative;
Hello again,
Thanks for everyone help on the key label question. After I tried the code of Mike Zdeb which worked great.
data save.cohorts;
set group(keep=herdcode string);
set nowrite.history1 key=herd / unique;
select (_iorc_);
when (%sysrc(_sok)) output;
when (%sysrc(_dsenom)) _error_ = 0;
otherwise do; put "UNEXPECTED ERROR"; stop; end;
end;
run;
BUT I think I may have set this up wrong initally. Below is what I need the code to do but I need something different that is going to run a lot faster than a merge for our web program. I thought first an index key read but that seems to only get me one observation. What the most efficient way to get the same result of the below code but in half the time?
data allwrite.cohorts;
merge group(keep=herdcode string) nowrite.history1 (in=a);
by herdcode string; if a;
run;
Crystal Vierhout
Dairy Records Management Systems
[text/html]