Help using Base SAS procedures

SAS-Mainframe

Reply
Contributor
Posts: 21

SAS-Mainframe

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

Super User
Posts: 3,101

SAS-Mainframe

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.

Contributor
Posts: 21

SAS-Mainframe

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.

New Contributor
Posts: 2

SAS-Mainframe

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.

Contributor
Posts: 21

SAS-Mainframe

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

Ask a Question
Discussion stats
  • 4 replies
  • 744 views
  • 0 likes
  • 3 in conversation