Hi ,I am new to SAS and I am not able to fix this error.This is my put '*------------------------------------------------------------* ;';
put '* Project Startup Code';
put '*------------------------------------------------------------* ;';
put 'options VALIDVARNAME=ANY;';
put 'libname CSIPA_DB odbc dsn=xxx user=xxx pw="xxx" schema=xxx;';
put 'OPTIONS SASTRACE='',,,d'' SASTRACELOC=SASLOG NOSTSUFFIX;';
put 'options mprint symbolgen mlogic source source2;';
put '%let em_debug=source method;';
put 'proc product_status;';
put 'run;';
put '''';
put 'libname MICINPUT "/var/blade/data3023/itiblade/sas_analysis_itg/lib/MI_Classification";';
put 'DATA MICINPUT.DatasetInput;';
put 'SET csipa_db.v_SAS_MI_Classification_Input;';
put ' ';
put 'RUN;';
put 'libname MICOUT "/var/blade/data3023/itiblade/sas_analysis_itg/lib/MI_Classification/MI_Output";';
put ' ';
put 'run;';
run;
%end;
%mend em_runstartupCode;
%em_runstartupCode;
When this is run I am getting the error
Line 30502: ERROR: Libref MICINPUT is not assigned.
Line 31407: ERROR: File is in use, /var/blade/data3023/itiblade/sas_analysis_itg/models/MIClassification/010_SAS_MICLASSIFY.log.
Line 31453: ERROR: Resource is write-locked by another user. File =/var/blade/data3023/itiblade/sas_analysis_itg/models/MIClassification/010_SAS_MICLASSIFY.log. System Error Code = 0.
Line 32273: ERROR: File is in use, /var/blade/data3023/itiblade/sas_analysis_itg/models/MIClassification/010_SAS_MICLASSIFY.log.
Line 32319: ERROR: Resource is write-locked by another user. File =/var/blade/data3023/itiblade/sas_analysis_itg/models/MIClassification/010_SAS_MICLASSIFY.log. System Error Code = 0.
Line 32787: ERROR: Libref MICINPUT is not assigned.
Line 35352: ERROR: Libref MICINPUT is not assigned.
How do I resolve this
First, you have to look for the place where library MICINPUT is assigned with a libname statement.
If there is no such statement, you either
- need to add it, pointing to the correct path.
- or make sure it is a predefined library in SAS metadata, depending on your environment
Next, you get error messages about a lock on file
/var/blade/data3023/itiblade/sas_analysis_itg/models/MIClassification/010_SAS_MICLASSIFY.log
This indicates that the file is already in use by another user or another process of yourself(!), probably by simply having it opened in and editor window.
If you can't identify that by your own resources, have a UNIX admin take a look with
fuser /var/blade/data3023/itiblade/sas_analysis_itg/models/MIClassification/010_SAS_MICLASSIFY.log
which will reveal the process(es) having an open file handle on the file.
Simplify your code:
Once you have done these two tasks re-test your code and if you still have problems re-post the code and the SAS log.
Your post is quite confusing. As @SASKiwi has stated there is no reason to put this in a macro, nor use put statements.
Secondly the error is telling you that it cannot set mcinput to that path as there are some files which are locked out. Is there are reason for that. It seems someone else is using those areas.
The code you poster has just ~25 lines, but your errors appear after lines 30000+. So there are 30000+ lines of code you have not shown that might contain the problem, as your code only puts things into the log and can NEVER have been the cause on it's own.
Hi KurtBremser,
Let me give a brief background of my program.I am reading records from the DataBase - using SAS tool to do some classification - send the results back to DataBase.
I relooked into the complete code and the issue now is that it is running fine without any error, but the data is not getting uploaded into the database. It looks like it runs into an temporary location and deletes the file .
Could you kindly help me here and I have attached the complete log file and sas code as well
Best regards
SavithaRavikumar
First, you have to look for the place where library MICINPUT is assigned with a libname statement.
If there is no such statement, you either
- need to add it, pointing to the correct path.
- or make sure it is a predefined library in SAS metadata, depending on your environment
Next, you get error messages about a lock on file
/var/blade/data3023/itiblade/sas_analysis_itg/models/MIClassification/010_SAS_MICLASSIFY.log
This indicates that the file is already in use by another user or another process of yourself(!), probably by simply having it opened in and editor window.
If you can't identify that by your own resources, have a UNIX admin take a look with
fuser /var/blade/data3023/itiblade/sas_analysis_itg/models/MIClassification/010_SAS_MICLASSIFY.log
which will reveal the process(es) having an open file handle on the file.
Thanks for your feedback.The issue was we hab more than one SAS job that was scheduled from Tidal to run and the process was locking up.As said by you all process was terminated and thr progarm went through without any errors
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.