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 🙂

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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