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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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.

View solution in original post

6 REPLIES 6
SASKiwi
PROC Star

Simplify your code:

 

  • You don't need to write your code with PUT statements, just write the statements directly (eg options VALIDVARNAME=ANY;)
  • Don't put your code inside a macro

 

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.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Kurt_Bremser
Super User

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.

SR88
Fluorite | Level 6

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

Kurt_Bremser
Super User

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.

SR88
Fluorite | Level 6

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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 6 replies
  • 2833 views
  • 3 likes
  • 4 in conversation