TERM:
put "End of test SCL integrity constraint"
"functions.";
return;
The previous code creates the SCL catalog entry. The following code creates two data
files, One and Two, and executes the SCL entry Example.Ic_Cat_Allics.SCL:
/* Submit to create data files. */
data one two;
input name $ age;
datalines;
Morris 13
Elaine 14
Tina 15
;
/* after compiling, run the SCL program */
proc display catalog= example.ic_cat.allics.scl;
run;
Removing Integrity Constraints
The following sample program segments remove integrity constraints. In the code that
deletes a primary key integrity constraint, note that the foreign key integrity constraint is
deleted first.
This program segment deletes integrity constraints using PROC SQL.
proc sql;
alter table salary
DROP CONSTRAINT for_key;
alter table people
DROP CONSTRAINT gender
DROP CONSTRAINT _nm0001_
DROP CONSTRAINT status
DROP CONSTRAINT prim_key
;
quit;
This program segment removes integrity constraints using PROC DATASETS.
proc datasets nolist;
modify tv_survey;
ic delete val_max;
ic delete val_gender;
ic delete val_age;
run;
quit;
This program segment removes integrity constraints using SCL.
TERM:
put "Opening WORK.TWO in utility mode.";
dsid2 = open( 'work.two' , 'V' ); /* Utility mode. */
if (dsid2 = 0) then
do;
636 Chapter 26 • SAS Data Files