If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
I’m pretty sure a current library always exists.
Type DSPLIBL and Enter from the command line. It will show you your library list. The entry with a type of “CUR” is your current library list. To change it, type CHGCURLIB from the command line, prompt it, and enter the library you want to be current. Hope this helps.
Shon
You will not see a *CUR library on your library list if your profile has *CRTDFT as the default for current library. Any commands that access or create objects in *CURLIB in this case will default to QGPL.
You can scan the system, current library and user library lists of a job using the RTVJOBA command from the appropriate parameters to look for a specific library or libraries using the QCLSCAN function. This also can be done in a HLL program using the appropriate API and a scan function. Check the Program and CL Command API manual for the specific examples.
I’m pretty sure a current library always exists.
Type DSPLIBL and Enter from the command line. It will show you your library list. The entry with a type of “CUR” is your current library list. To change it, type CHGCURLIB from the command line, prompt it, and enter the library you want to be current. Hope this helps.
Shon
How to see if a CERTAIN library is in you library list.
/* see if library MyLib is in the library list */
ADDLIBLE LIB(MyLib) POSITION(*LAST)
MONMSG MSGID(CPF2103) EXEC(DO)
RCVMSG
CHGVAR VAR(&INLIBL) VALUE(Y)
GOTO CMDLBL(ENDLIBLCHK)
ENDDO
RMVLIBLE LIB(MyLib)
CHGVAR VAR(&INLIBL) VALUE(N)
ENDLIBLCHK:
You will not see a *CUR library on your library list if your profile has *CRTDFT as the default for current library. Any commands that access or create objects in *CURLIB in this case will default to QGPL.
You can scan the system, current library and user library lists of a job using the RTVJOBA command from the appropriate parameters to look for a specific library or libraries using the QCLSCAN function. This also can be done in a HLL program using the appropriate API and a scan function. Check the Program and CL Command API manual for the specific examples.
I assume you want to know if a “specific” lib is available. If that is what you want you can do if defined …
In a CLLE pgm
RMVLIBLE LIB(libname)
MONMSG CPF0000
ADDLIBLE LIB(libname) POSITION(position)
MONMSG CPF0000
The libray name can also be code as a variable