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

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 🙂
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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 🙂


 

View solution in original post

2 REPLIES 2
Reeza
Super User

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 🙂


 

Darshik
Calcite | Level 5

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 🙂

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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