The Create Externally Described Printer File command reads an RPG or
RPGLE (fixed format) source member with a program described printer
file and creates the DDS for an externally described printer file and
the printer file. Exceptions such as duplicate output lines for the
same EXCPT line are noted and a new format name is assigned. The RPG
source is not changed. You must make changes to the RPG source as
well as correct any exceptions that are noted.
If the RPG program uses an externally described file (such as a data
base file), the file must be found on the library list. This allows
the definition of externally described fields to be found.
If you have multiple printer files in the program, you must have a
unique printer file for each. See the PRINTER parameter which will
allow you to identify which PRINTER file you want to make an
externally described file for.
A typical CRTEXTPRTF command would be:
CRTEXTPRTF RPGSRCM(ABCR) DDSSRCM(ABCX)
The command would read the ABCR member in QRPGSRC and output DDS
Printer specs to the ABCX member in QDDSSRC. The first 3 lines
output will be comments describing the source and when and where it
was created from. The ABCX printer file would be created in the
current library assuming no errors exist in the DDS source.
If any exceptions exist, an escape message would be sent and you must
review the spooled file name ABCR (see later discussion).
Any comments in the output specifications are copied to the DDS
specifications.
Standard changes to the RPG program must be made such as:
** The F spec must be changed. For example, if you had used
QPRINT as the printer file name, you would make the following
change:
Before: FQPRINT O F 132 OF PRINTER
After: FABCX O E nn PRINTER
The OF indicator must be replaced by a 01-99 indicator that
you are not using in the program.
** Any references to the OF indicator must be changed to your
assigned indicator.
** Review the ABCR spooled file for exceptions. It will describe
the sequence number of any exceptions and the exception
condition. This includes:
-- RPG program described output specs allow for multiple
lines to be output for H, D, T, or multiple E lines for
the same EXCPT name. Each line of output must have a
unique format name in DDS. CRTEXTPRTF generates names
of $$nnnn for each duplicate.
You must change the RPG program for WRITE statements to
output each format. For H, D, or T lines, you must add
a WRITE statement at the appropriate point in the RPG
program. For E lines, you must change the EXCPT to a
WRITE and add new WRITE statements if any additional
$$nnnn format names have been generated (you may change
the DDS specifications to make the $$nnnn assigned
names more meaningful and re-create the printer file).
Assume your RPG calculations specify:
C EXCPTTOTAL
C OF EXCPTHDG
Assume 1) Each exception output to TOTAL causes 2 lines
and the HDG output causes 3 lines. When CRTEXTPRTF is
run, assume it has generated $$0001 for the second HDG
line, $$0002 for the third HDG line, and $$0003 for the
second TOTAL line. When you modified the RPG F spec,
assume you assigned an overflow indicator of 75 in
place of OF. Your modified RPG code would look like:
C WRITETOTAL
C WRITE%%0003
C 75 DO
C WRITEHDG
C WRITE$$0002
C WRITE$$0003
C SETOF 75
C ENDDO
-- RPG allows a format name to be output based on
conditioning indicators. DDS does not support this.
You must change the RPG code such as conditioning the
WRITE statement.
-- RPG Reserved words Reserved words beginning with * or
UDATE, UDAY, UMONTH, or UYEAR are flagged and not
supported.
-- Blank after. RPG supports the ability to blank out (or
zero out) a field after it has been output. DDS does
not support this. You must add RPG statements such as
RPG MOVE/Z-ADD statements to provide for this.
-- P/B/L/R Column (44). RPG supports P/B/L/R in column
44. DDS does not support a direct solution to emulate.
-- Fetch overflow. RPG supports an 'F' for fetch overflow
in column 16. DDS does not support this. You must use
RPG logic to account for this.
-- Un indicators. RPG supports Un indicators, they are
not supported by DDS. Different indicators must be
assigned.
-- Array elements output as fields. RPG allows an array
element to be output such as AR1,XX. DDS does not
support arrays. The field name will be changed to
AR1$XX with the proper length and decimals considered.
You must change the source to move from the array
element to this field name.
-- Field name used multiple times in an output line. RPG
allows the same field name to be output multiple times
in one line. DDS restricts this to once per format.
If such fields exist, the CRTPRTF command will fail and
the DDS must be corrected manually.
-- RPGLE supports continuation lines for constants ending
with a minus sign. The minus is replaced with an
ending quote and the line is output with a warning
message as only the length of the first line is
calculated to determine and end position. The
additional lines will cause errors when attempting to
create a printer file.
-- AND/OR lines. The generated DDS specifications may
cause an error because the keywords for space/skip must
be specified on the last AND/OR line.
CRTEXTPRTF escape messages you can monitor for
----------------------------------------------
TAA9891 Exceptions found. See the spooled listing.
Escape messages from based on functions will be re-sent.
Command parameters *CMD
------------------
RPGSRCM The RPG source member to be read.
RPGSRCF The RPG source file containing the member to be
read. QRPGSRC is the default. The library
qualifier defaults to *LIBL. A specific library or
*CURLIB may be specified.
DDSSRCM The DDS source member to be output to. The default
is *RPGSRCM for the member named in the RPGSRCM
parameter.
The member must not exist. It will be added by
CRTEXTPRTF. See the exception with the DLTRMV
parameter.
DDSSRCF The DDS source file to contain the external printer
specs. QDDSSRC is the default. The library
qualifier defaults to *LIBL. A specific library or
*CURLIB may be specified.
PRTF The qualified name of the Printer file to be
created. The default is *DDSSRCM which is the name
of the member specified in the DDSSRCM parameter.
The library qualifier defaults to *CURLIB. A
specific library may be named.
The file must not exist. See the exception with the
DLTRMV parameter.
TEXT The text description assigned to the DDS source
member and used for the object description of the
generated Printer file. The default is *DFT which
means the same text description as exists for the
RPG source member.
PRINTER The printer file to generate DDS source for. The
default is *ONLY meaning there is only a single
printer file described in the RPG source.
If multiple printer files exist, you must specify
the name of one of the files to generate DDS source
for. CRTEXTPRTF may be used for each program
described printer file that exists in a program.
DLTRMV A testing option that defaults to *NO. The normal
use of CRTEXTPRTF requires the DDS member and the
Printer file not exist. They will be added by
CRTEXTPRTF.
*YES may be specified in a testing environment to
remove the DDS member if it exists and delete the
Printer file if it exists.
Restrictions
------------
See the previous comments.
Prerequisites
-------------
The following TAA Tools must be on your system:
CHKOBJ3 Check object 3
EDTVAR Edit variable
HLRMVMSG HLL Remove message
RSNLSTMSG Resend last message
RTVDAT Retrieve date
RTVDBFA Retrieve data base file attributes
RTVRPGFLD Retrieve RPG field
RTVSYSVAL3 Retrieve system value 3
SNDCOMPMSG Send completion message
SNDESCINF Send escape information
SNDESCMSG Send escape message
SNDSTSMSG Send status message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CRTEXTPRTF *CMD TAAPRTI QATTCMD
TAAPRTIC *PGM CLP TAAPRTIC QATTCL
TAAPRTIR *PGM RPG TAAPRTIR QATTRPG
TAAPRTIR2 *PGM RPG TAAPRTIR2 QATTRPG
TAAPRTIR is used for RPG types. TAAPRTIR2 is used for RPGLE types.
|