DATA Step, Macro, Functions and more

Foreign Key problems

Reply
Frequent Contributor
Posts: 99

Foreign Key problems

I can't make this code work

 

proc sql;
  create table foo (
    id char(11)
  );

  create table bar (
    id char(11)
  );

quit;


proc datasets lib=work;

	modify foo;
		ic create primary key(id);
	modify bar;
		ic create primary key(id);
		ic create fkey = foreign key(id) references foo;

run;

I'm getting the following errors:

 

ERROR: An index named id with the same definition but different characteristics exists for file WORK.BAR.DATA.
Respected Advisor
Posts: 4,736

Re: Foreign Key problems

Posted in reply to tomcmacdonald
Ask a Question
Discussion stats
  • 1 reply
  • 88 views
  • 0 likes
  • 2 in conversation