DATA Step, Macro, Functions and more

Startup Code Error

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Startup Code Error

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


Accepted Solutions
Solution
‎11-11-2016 01:34 AM
Super User
Posts: 6,936

Re: Startup Code Error

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Super User
Posts: 3,105

Re: Startup Code Error

Simplify your code:

 

  • You don't need to write your code with PUT statements, just write the statements directly (eg options VALIDVARNAME=ANYSmiley Wink
  • 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.

Super User
Super User
Posts: 7,401

Re: Startup Code Error

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.

Super User
Posts: 6,936

Re: Startup Code Error

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 3

Re: Startup Code Error

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

Attachment
Solution
‎11-11-2016 01:34 AM
Super User
Posts: 6,936

Re: Startup Code Error

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 3

Re: Startup Code Error

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 470 views
  • 2 likes
  • 4 in conversation