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:
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;________________________22201ERROR 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 secondscpu time 0.23 secondsI am unable to understand this error and how to resolve it.Note: I am using the free SAS Studio University EditionThanks in advance for your help and insight 🙂
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;________________________22201ERROR 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 secondscpu time 0.23 secondsI am unable to understand this error and how to resolve it.Note: I am using the free SAS Studio University EditionThanks in advance for your help and insight 🙂
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 🙂
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.
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.