DATA Step, Macro, Functions and more

Error creating a integrity constraint for permanent library

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

Error creating a integrity constraint for permanent library

Hi,

 

I created the below program create an integrity constraint.

 

The program successfully runs when I create it using work library. Below is the code:

 

proc datasets;
modify insurance_master;
ic create val_unsb=check(where=(unsb in(0,1)))
message='Valid values are either 0 or 1';
quit;

 

However, I get the below error message when I try to create the same file in my permanent library. Below is code and log:

 

proc datasets;
modify darshik.insurance_master;
ic create val_unsb=check(where=(unsb in(0,1)))
message='Valid values are either 0 or 1';
quit;

Log:

73 proc datasets;
74 modify darshik.insurance_master;
________________________
22
201
ERROR 22-322: Expecting a name.
ERROR 201-322: The option is not recognized and will be ignored.
75 ic create val_unsb=check(where=(unsb in(0,1)))
NOTE: Enter RUN; to continue or QUIT; to end the procedure.
76 message='Valid values are either 0 or 1';
77 quit;
 
NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DATASETS used (Total process time):
real time 0.24 seconds
cpu time 0.23 seconds
 
I am unable to understand this error and how to resolve it. 
 
Note: I am using the free SAS Studio University Edition
 
Thanks in advance for your help and insight Smiley Happy

Accepted Solutions
Solution
‎02-27-2018 02:49 PM
Super User
Posts: 23,296

Re: Error creating a integrity constraint for permanent library

[ Edited ]

Your code is incorrect in specifying the libname and data set name. Your first example only happens to work because the default library is work, otherwise you specify the LIB in the PROC DATASETS statement and the data set name in the MODIFY statement.

 

proc datasets lib=darshik;
modify insurance_master;
ic create val_unsb=check(where=(unsb in(0,1)))
message='Valid values are either 0 or 1';
quit;

Darshik wrote:

Hi,

 

I created the below program create an integrity constraint.

 

The program successfully runs when I create it using work library. Below is the code:

 

proc datasets;
modify insurance_master;
ic create val_unsb=check(where=(unsb in(0,1)))
message='Valid values are either 0 or 1';
quit;

 

However, I get the below error message when I try to create the same file in my permanent library. Below is code and log:

 

proc datasets;
modify darshik.insurance_master;
ic create val_unsb=check(where=(unsb in(0,1)))
message='Valid values are either 0 or 1';
quit;

Log:

73 proc datasets;
74 modify darshik.insurance_master;
________________________
22
201
ERROR 22-322: Expecting a name.
ERROR 201-322: The option is not recognized and will be ignored.
75 ic create val_unsb=check(where=(unsb in(0,1)))
NOTE: Enter RUN; to continue or QUIT; to end the procedure.
76 message='Valid values are either 0 or 1';
77 quit;
 
NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DATASETS used (Total process time):
real time 0.24 seconds
cpu time 0.23 seconds
 
I am unable to understand this error and how to resolve it. 
 
Note: I am using the free SAS Studio University Edition
 
Thanks in advance for your help and insight Smiley Happy


 

View solution in original post


All Replies
Solution
‎02-27-2018 02:49 PM
Super User
Posts: 23,296

Re: Error creating a integrity constraint for permanent library

[ Edited ]

Your code is incorrect in specifying the libname and data set name. Your first example only happens to work because the default library is work, otherwise you specify the LIB in the PROC DATASETS statement and the data set name in the MODIFY statement.

 

proc datasets lib=darshik;
modify insurance_master;
ic create val_unsb=check(where=(unsb in(0,1)))
message='Valid values are either 0 or 1';
quit;

Darshik wrote:

Hi,

 

I created the below program create an integrity constraint.

 

The program successfully runs when I create it using work library. Below is the code:

 

proc datasets;
modify insurance_master;
ic create val_unsb=check(where=(unsb in(0,1)))
message='Valid values are either 0 or 1';
quit;

 

However, I get the below error message when I try to create the same file in my permanent library. Below is code and log:

 

proc datasets;
modify darshik.insurance_master;
ic create val_unsb=check(where=(unsb in(0,1)))
message='Valid values are either 0 or 1';
quit;

Log:

73 proc datasets;
74 modify darshik.insurance_master;
________________________
22
201
ERROR 22-322: Expecting a name.
ERROR 201-322: The option is not recognized and will be ignored.
75 ic create val_unsb=check(where=(unsb in(0,1)))
NOTE: Enter RUN; to continue or QUIT; to end the procedure.
76 message='Valid values are either 0 or 1';
77 quit;
 
NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DATASETS used (Total process time):
real time 0.24 seconds
cpu time 0.23 seconds
 
I am unable to understand this error and how to resolve it. 
 
Note: I am using the free SAS Studio University Edition
 
Thanks in advance for your help and insight Smiley Happy


 

Occasional Contributor
Posts: 6

Re: Error creating a integrity constraint for permanent library

Thank you so much!

 

The error makes sense to me now. I have been practicing different proc statements to be more fluent with it.

 

Thanks again for the solution, will keep that in mind Smiley Happy

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 122 views
  • 2 likes
  • 2 in conversation