|
Jeff, It works well for me (I've done a couple of SUGI papers on it). Did you
use PROC DATASETS to define PARTNO as an index for PARTCODE:
PROC DATASETS LIBRARY=WORK;
MODIFY PARTCODE;
INDEX CREATE PARTNO;
RUN;
QUIT;
or at dataset creation:
DATA PARTCODE(INDEX=PARTCODE);
...
RUN;
By the way, regardless of how you define the index, use the /UNIQUE option on
the SET statement. Otherwise, if you search for the same PARTNO value twice in
a row, the second search fails. It is slightly confusing that /UNIQUE during
index creation means something completely different from /UNIQUE during index
access. This decision was probably made by the person who decided you should
code QUIT to get out of PROC DATASETS and RUN to run some commands but remain in
PROC DATASETS.
Tim Berryhill - Contract Programmer and General Wizard
TWB2@PGE.COM or http://www.aartwolf.com/twb.html
Frequently at Pacific Gas & Electric Co., San Francisco
The correlation coefficient between their views and
my postings is slightly less than 0
----------------------[Reply - Original Message]----------------------
Sent by:"jeff.cummings@nationsbank.com" <jeff.cummings@NATIONSBANK.COM>
Has anyone successfully used the KEY option in the SET statement of a data
step? When I use the sample code provided in Technical Report P-222
data combine;
set invtory(keep=partno instock price);
set partcode(keep=partno desc) key=partno;
run;
I get the following error:
ERROR: No key variables have been defined for file PARTCODE.
Any suggestions or tips?
Thanks,
Jeff Cummings
NationsBank
=====================================================================
|