Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
The iQuery.xxxLIBL() UDFs and iQuery.xxxLIBL() Stored Procedures allow uses to use SQL to check and change the library list for the job.
Name | Type | Parameter(s) | Description |
CHKLIBLE | UDF | varchar(10) | Check the library list for the specified library name. Returns 1 if found, 0 if not found. |
ADDLIBLE | Proc | varchar(3000) | Add one or more libraries to the library list. Library names are separated by one or more blanks. |
RMVLIBLE | Proc | varchar(3000) | Remove one or more libraries from the library list. Library names are separated by one or more blanks. |
CHGLIBL | Proc | varchar(3000) | Replaces the user-portion of the library list with the list of library names (separated by one or more blanks). |
CHGCURLIB | Proc | varchar(10) | Changes the Current Library of the library list to the library name specified. |
The CHKLIBLE UDF can be used to verify that a library is on the library list before running other SQL statements or CL commands.
The Procedures (ADDLIBLE, RMVLIBLE, CHGLIBL) will modify the user portion of the job's library list. Note that ADDLIBL and RMVLIBL are alternate spellings for the ADDLIBLE and RMVLIBLE procedures, respectively.
EXEC SQL CALL iQuery.addlible('ORDENTRY SALESHIST IQUERY');
if (chklible('SALESHIST') = 0);
call iQuery.addlible('SALESHIST');
endif;
exec sql values iQuery.chklible('SALESHIST') into :libExists;
if (libExists = 0);
exec SQL call iQuery.addlible('SALESHIST');
endif;