BookmarkSubscribeRSS Feed
Sudtej
Calcite | Level 5

Hi,

I have a query regarding SAS Mainframe, I have a below code in PC SAS.

LIBNAME IN0 "ES.D.SASD.TM.DAILY.PS(00)" DISP=SHR;

LIBNAME IN1 "EU.D.SASD.TM.DAILY.PS(-1)" DISP=SHR;

data today;

merge in0.data (in=a)

      in1.data (in=b)

if a;

run;

While running the above code if somebody using the above file(mentioned in Libname) then SAS will give me error that "file in use" ultimately end up in waiting for some more time and again run the whole code. Can someone suggest me how to avoid this same error.

Let me know if require more info

Thnaks,

Sudtej

4 REPLIES 4
SASKiwi
PROC Star

Suggest you read the documention for the LIBNAME statement for zOS:

http://support.sas.com/documentation/cdl/en/hosto390/61886/HTML/default/viewer.htm#mvs-stmt-libname....

If every user assigns the LIBNAME with DISP=SHR then there will be no file in use errors.

If one user assigns it with DISP=OLD it will block all other users until it is cleared. There is no option but to wait if this is the case. You should check out the WAIT= option on the LIBNAME statement as this will pause your program for the specified time in the hope that the other users library assignment clears.

Sudtej
Calcite | Level 5

I have gone through the above link, i am using DISP=SHR option still i am getting "File in use error".

Let me chk out again. Thanks for your reply.

pcorbridge
Calcite | Level 5

Hi,

What SASKiwi is saying is that even though you are using the DISP=SHR option, someone else if reading the file with the DISP=OLD option.

Therefore, you won't be able to read it until the other users assignment clears. If you find the offending user(s) and get them to amend their SAS/JCL to DISP=SHR then you will be OK.

Sudtej
Calcite | Level 5

yes, you are correct!! i understood your point Thanks a lot for help

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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