BookmarkSubscribeRSS Feed
pope1970
Calcite | Level 5

The first JOB created succesfully the log file DIM.log.

This is the code

     Filename ff_log ""/sas/logs/DIM.log";

      proc printto

       Log=ff_log;

      run;

So now I want to append to content of the second job (log process)  to the DIM.log

My Precode piece of code for Table Loader is

  Filename ff_log  "/sas/logs/DIM.log" mod;

      proc printto

       Log=ff_log;

      run;

But I am getting the error

ERROR: File is in use, /sas/logs/DIM.log. NOTE: The SAS System stopped processing this step because of errors.

NOTE:

The error above I am getting when I try to append log process info of the second job to the same file DIM.log (created by first job).

I can append log info with no errors if I want to append info to DIM.log by the first job.

The log file was not opened.

2 REPLIES 2
LinusH
Tourmaline | Level 20

Sorry, but I don't have an immediate answer to you r problem.

But may I ask why you wish to store DI Studio logs in this "controlled" manner?

DIS is primarily a tool for maintaining meta data and building jobs, which then deploy for scheduling (if they are type of jobs that will run on a predictable and regular basis. Jobs that are to be run under ad-hoc circumstances, they can be deployed as stored processes.

Data never sleeps
Patrick
Opal | Level 21

I agree with what Linus says.

Your sample code run without errors for me (after removing the duplicated quotations marks in the first filename statement) when used in 2 different jobs AND the first job had been closed.

So just thinking:

If you run both jobs out of DIS (which spawns a session per job) and you don't close the job window after running the first job then the session is still active and the log file still locked (by the filename statement). So if this is the case and you run the second job out of DIS then the Error you're getting is simply stating the fact that job1 is still locking the log file.

Fully close job1 after running it and I would expect things to work.

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 connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 903 views
  • 0 likes
  • 3 in conversation