06-05-2016 04:36 PM
I have added constraints into a table but it removes it when someone overwrites the table. Is there any way to prevent it?
DATA TEMP; SET SASHELP.CLASS; RUN; PROC SQL; ALTER TABLE TEMP ADD CONSTRAINT NOT_NULL_WEIGHT NOT NULL(WEIGHT); QUIT; DATA TEMP; SET TEMP; IF AGE >=15 THEN WEIGHT = .; RUN;
06-05-2016 10:29 PM
Use MODIFY if you want to retain the constraint. But note that
IF AGE >=15 THEN WEIGHT = .;
is not equivalent to the SQL UPDATE query above. There is no rollback with MODIFY.
Need further help from the community? Please ask a new question.