The Retrieve Library Source Files command retrieves a list of source
files in a library. The list is returned in a large variable.
The following CL code is in a format that is ready to be copied to a
CL program that will return all source files in a library.
DCL &SRCFILES *CHAR LEN(9990)
DCL &FILCNT *DEC LEN(5 0)
DCL &SRCF *CHAR LEN(10)
DCL &FX *DEC LEN(5 0)
.
RTVLIBSRCF LIB(&LIB) SRCFILES(&SRCFILES) FILCNT(&FILCNT)
CHGVAR &LX -9
LOOP: CHGVAR &LX (&LX + 10)
IF (&LX *LT 9990) DO /* LT 9990 */
CHGVAR &SRCF %SST(&SRCFILES &LX 10)
IF (&SRCF *NE ' ') DO /* Not blank */
/*******************************************/
/* */
/* Do your thing with &SRCF */
/* */
/*******************************************/
GOTO LOOP
ENDDO /* Not blank */
ENDDO /* LT 9990 */
If less than 999 source fields exist, the remaining space will be
blank. If more than 999 source files exist, the first 999 will be
placed in the &SRCFILES return parameter.
Subsetting the list
-------------------
There are several methods of subsetting the list of source files that
are returned by specifying the TYPE parameter.
** *STD means that the only files returned must match those
described by the RTVSRCTYP TAA Tool. This list includes the
standard file names associated with source types described in
system help text. See the discussion with RTVSRCTYP.
** *SRC1, *SRC2, and *SRC3 mean that a data area must exist on
the library list by the corresponding names of SRCLST1,
SRCLST2, and SRCLST3. These data areas must contain the name
of the source files to be checked. Only source files that
exist and match one of those found in the data area will be
returned. See the discussion with the CRTSRCFLST tool.
** *QATT and *QATT2 mean the only files returned must match those
described in the RTVQATTF TAA Tool. This is either a short or
long list of QATTxxx source file names. See the RTVQATTF TAA
Tool for a complete description.
RTVLIBSRCF escape messages you can monitor for
-----------------------------------------------
TAA9891 The library does not exist.
TAA9892 No source files exist to be returned.
TAA9893 Not authorized to the library.
TAA9894 Data area not found on library list.
The TAA9892 message can occur because no source files exist or none
match the criteria specified for the TYPE parameter. The text of the
message will state how many source files exist in the library.
Escape messages from system commands will be re-sent.
Command parameters *CMD
------------------
LIB The library containing the source files to be
accessed.
SRCFILES An optional return variable. If used, it must be
specified as *CHAR LEN(9990). Each source file
takes 10 bytes (1-10, 11-20, etc.) If less than 999
source files exist, the remaining space will be
blank. See the tool documentation for sample code
to copy.
If more than 999 source files exist, the command
completes normally with the first 999 returned in
SRCFILES and the FILCNT parameter describing the
number that exist.
FILCNT An optional return variable. If used, it must be
specified as *DEC LEN(5 0). The parameter will
contain the number of source files found.
TYPE The type of source files to be returned. *ALL is
the default meaning all source files in the library.
*STD may be specified to mean the only files
returned must exist and be described by the
PRTSRCTYP TAA Tool. This list includes the standard
file names associated with source types described in
system help text. See the discussion with
PRTSRCTYP.
*SRC1, *SRC2, and *SRC3 mean that a data area must
exist on the library list by the corresponding names
of SRCLST1, SRCLST2, and SRCLST3. These data areas
must contain the name of the source files to be
checked. Only source files that exist and match one
of those found in the data area will be returned.
See the discussion with the CRTSRCFLST tool.
*QATT or *QATT2 may be specified to mean the only
files returned must match those described in the
RTVQATTF TAA Tool. This is either a short or long
list of QATTxxx source file names. See the RTVQATTF
TAA Tool for a complete description.
Restrictions
------------
Because the command returns variables, it can only be used in a CL
program.
Prerequisites
-------------
The following TAA Tools must be on your system:
EDTVAR Edit variable
RTVQATTF Retrieve QATT source files
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
RTVLIBSRCF *CMD TAASRDV QATTCMD
TAASRDVC *PGM CLP TAASRDVC QATTCL
TAASRDVR *PGM RPG TAASRDVR QATTRPG
|