LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 1997, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 9 Oct 1997 13:08:45 PDT
Reply-To:   TWB2%Rates%FAR@bangate.pge.com
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Tim Berryhill 3rd time <TWB2%Rates%FAR@BANGATE.PGE.COM>
Subject:   Re: KEY= Option of the SET Statement
Comments:   To: jeff.cummings@NATIONSBANK.COM

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

=====================================================================


Back to: Top of message | Previous page | Main SAS-L page