Another question about applying PTFs. I attempt to allocate the objects to be replaced before applying the PTF in my PTF exit program. However, I cannot allocate a DSPF (the ALCOBJ won't let me do that). This will cause a problem if I try to apply the PTF and a user has the DSPF in use. How can I determine if the DSPF is available to be replaced?
You could use the API QWCLOBJL to list object locks but this also involves the use of user spaces etc.
For a simpler approach, you could try to change the display file. If the file is in use, the change will fail and you can monitor for a file not changed message. The following code shows an example of this:
PGM DCL VAR(&TEXT) TYPE(*CHAR) LEN(50) RTVOBJD OBJ(MYLIB/MYDSPF) OBJTYPE(*FILE) TEXT(&TEXT) CHGDSPF FILE(MYLIB/MYDSPF) TEXT(&TEXT) MONMSG MSGID(CPF7304) /* Change did not happen */ ENDPGM
MORE INFORMATION ON THIS TOPIC
The Best Web Links: tips, tutorials and more.
Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.