RTVSRCSTMT RETRIEVE SOURCE STATEMENT TAASREC |
The Retrieve Source Statement command allows a retrieve of a single
source statement from a source member based on a relative record
number or an argument to be scanned for. This allows a CL program to
make a determination about a statement in the source.
A typical command would be:
DCL &SRCDTA *CHAR LEN(228)
.
RTVSRCSTMT SRCFILE(xxx) MBR(yyy) RELRCD(1) +
RTNSRCDTA(&SRCDTA)
The statement returned is 228 bytes to allow for the widest source
file that can be used by SEU. Since relative record 1 is requested,
the first statement in the source member would be returned.
To scan for the first statement with an XYZ value, you would specify:
RTVSRCSTMT SRCFILE(xxx) MBR(yyy) ARGUMENT(XYZ)
RTNSRCDTA(&SRCDTA)
When scanning for an argument, the scan begins with the first source
statement and returns the first statement that matches the argument.
RTVSRCSTMT escape messages you can monitor for
----------------------------------------------
TAA9891 No records exist in the member.
TAA9892 Relative Record number does not exist.
TAA9893 Argument value does not exist.
TAA9894 Argument value excess length of source data.
Escape messages from based on functions will be re-sent.
Command parameters *CMD
------------------
SRCFILE The qualified name of the source file to be
retrieved from. The library value defaults to
*LIBL. *CURLIB may also be used.
MBR The member to be retrieved from. *FIRST may be
specified for the first member in the file.
RELRCD The relative record number to be retrieved. The
default is *NONE meaning the ARGUMENT value is used.
If a value is entered, it must be between 1 and
32,767. Both RELRCD and ARGUMENT cannot be *NONE.
ARGUMENT The value to be scanned for. The default is *NONE.
Both RELRCD and ARGUMENT cannot be *NONE. See also
the TRANSLATE parameter.
If scanning for lower case, enter the argument in
quotes and specify TRANSLATE(*NO).
Up to 228 bytes can be entered. The actual length
of the value is determined by the last non-blank.
The actual length must be less than or equal to the
SRCDTA field of the source file (such as 80 or 92).
TRANSLATE Whether to translate the source statements before
scanning for the argument value. The default is
*YES meaning the source statements are translated to
upper case using the TAA Tool RTVTRNTBL which
determines the translate table to use to fold lower
to upper case. The value is ignored if using
Relative Record number.
The TAA Tool RTVTRNTBL uses a default for the
QSYSTRNTBL table in QSYS which allows translation of
lower case English to upper case. See the
discussion for RTVTRNTBL.
*NO may be specified so the scan is case sensitive.
If you specify an argument in lower case, use quotes
around the ARGUMENT value.
RTNSRCDTA The statement to be returned. This is an optional
return value that if used must be declared as *CHAR
LEN(228) to hold the widest source statement that
may be used with SEU.
RTNSRCSEQ The sequence number of the statement returned. This
differs from RTNSRCSEQ2 in that the DCL must have 2
decimal positions. This is an optional return value
that if used must be declared as *DEC LEN(6 2).
RTNSRCSEQ2 The sequence number of the statement returned. This
differs from RTNSRCSEQ in that the DCL must have 0
decimal positions. This is an optional return value
that if used must be declared as *DEC LEN(6 0).
RTNSRCDAT The last source change date of the statement
returned. This is an optional return value that if
used must be declared as *DEC LEN(6 0). The format
is YYMMDD.
RTNLIB The library containing the source file that was
retrieved. This is an optional return value that if
used must be declared as *CHAR LEN(10). This value
may be helpful if a special value was used for the
source file library.
RTNMBR The member in the source file that was retrieved.
This is an optional return value that if used must
be declared as *CHAR LEN(10). This value may be
helpful if *FIRST was used for the source file
member.
Restrictions
------------
None.
Prerequisites
-------------
The following TAA Tools must be on your system:
EDTVAR Edit variable
FILEFDBCK File feedback
HLRMVMSG HLL Remove message
RTVDBFA Retrieve data base file attributes
RTVTRNTBL Retrieve translate table
SNDESCMSG Send escape message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
RTVSRCSTMT *CMD TAASREC QATTCMD
TAASRECC *PGM CLP TAASRECC QATTCL
TAASRECR *PGM RPG TAASRECR QATTRPG
|
Added to TAA Productivity tools July 1, 1999