BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ping
Fluorite | Level 6

data master;   

input dt $ dept $ sales;   

datalines;       

DEC-2013 PC 2000       

NOV-2013 PC 1500       

DEC-2012 MOBILE 3000   

;

run;

DATA lkup;

input dept $ percent; datalines;    

  PC 0.4   

  MOBILE 0.6 ;

run;

proc sql;   

create index dept on lkup(dept);   

quit;

data merged;   

set master;   

set lkup key=dept;   

x=_IORC_;

run;

I am getting error on second row, it should find match and no error is reported. Can anyone explain me what's wrong in the code?

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Try adding /UNIQUE option.

set lkup key=dept / unique;

View solution in original post

3 REPLIES 3
ping
Fluorite | Level 6

dt=NOV-2013 dept=PC sales=1500 percent=0.4 x=1230015 _ERROR_=1 _IORC_=1230015 _N_=2

Tom
Super User Tom
Super User

Try adding /UNIQUE option.

set lkup key=dept / unique;

ping
Fluorite | Level 6

Works. Thanks a bunch.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1845 views
  • 0 likes
  • 2 in conversation