02-14-2012 01:16 AM
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;
merge in0.data (in=a)
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
02-14-2012 02:18 PM
Suggest you read the documention for the LIBNAME statement for zOS:
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.
02-15-2012 05:07 AM
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.