The Copy Source Header command copies a standard source header
(several lines of comments) for the heading section of a new or
existing source member. Some of the values in the header are updated
by the command. The intent of the command is that the programmer
would begin a new member by using CPYSRCHDR. Standard PDM options
exist. A method of tailoring the standard headers is provided for.
A typical command would be:
CPYSRCHDR MBR(ABC) SRCTYP(CLP) TEXT('A good member')
By default, the value of the source type parameter is used to
determine the source file to be added to. The standard source file
names such as QCLSRC are used. The member must not exist when the
default of NEWMBR(*YES) is specified and a text description must be
provided.
The source header would look as follows:
/********************************************************************/
/* */
/* Name . . . . . ABC Type . . CLP */
/* */
/* Text descrp . . A good member */
/* */
/* */
/* Created . . . . 05/10/01 by JMILLER */
/* */
/* Description . . xxxxx */
/* xxxxx */
/* */
/* Revision . . . nn */
/* xx/xx/xx by yy */
/* Description . xxxxx */
/* */
/********************************************************************/
Note that the member name, type, text description, create date, and
user are updated automatically by the command. The member text
description may take 2 lines. The ending word on the first line will
not be split.
It is intended for the programmer to fill in the remainder of the
header.
Existing member
---------------
If the member already exists, the header is placed at the beginning
of the member. The source type, text, and create date are accessed
from the existing member and placed in the header. A text
description must exist for the member. The current user name is used
in the header.
The TEXT parameter on the command must be *SAME. The member
description is not changed.
The technique used is to copy any existing source to the CPYSRCHDR
source file in TAAWORK. The TAAWORK/CPYSRCHDR source file is created
if it does not exist and specified as AUT(*ALL).
The standard header is then copied into the existing member with
MBROPT(*REPLACE). The source in TAAWORK/CPYSRCHDR is then added back
to the original member. The member in TAAWORK/CPYSRCHDR is then
removed.
If a failure occurs, you should be able to recover your original
source from the same member name in TAAWORK/CPYSRCHDR.
Adding PDM Options
------------------
You may add a PDM option for both the new and existing member
functions by using the TAA ADDPDMOPT command. The defaults are:
HN = New Member
HE = Existing member.
You may assign different defaults.
Before using WRKMBRPDM, enter the command:
ADDPDMOPT TAACMD(CPYSRCHDR)
A prompt override program will prompt for the remainder of the
command with the default HN assigned.
Then enter the command:
ADDPDMOPT TAACMD(CPYSRCHDR2)
The prompt override program will prompt for the remainder of the
command with the default of HE. Note that the CPYSRCHDR2 command
does not exist. It is specified on ADDPDMOPT only to add the
Existing Member function.
Using the PDM Options
---------------------
The HN option (or your value) for adding a new member may be entered
next to any member in the file when using WRKMBRPDM. The member you
place the entry on is not used (this technique is required because
the options can only be entered next to an existing member instead of
an alternate form of F6 for adding a new member).
The HN option will cause a prompt for the CPYSRCHDR command with the
file and library parameters filled in based on the current file and
library you are working on.
The HE option (or your value) for adding to an existing member does
not prompt. It just copies the standard header into the source
member.
If a new member is entered using the PDM F6 function and no
statements are added when the programmer decides that he needs a
standard header, two solutions exist:
** Enter at least one statement, end the source entry function,
and use the HE function on the existing member.
** End the source entry function (the member is not added if no
statements exist) and use the HN function on any member.
Standard headers
----------------
The following standard headers are used in file CPYSRCHDR in
TAASECURE for the corresponding source types and source files
Member Source type
------ -----------
TAASREH CMD CL CLP CLLE
TAASREHR RPG RPGLE
TAASREHP PF LF DSPF PRTF CBL CBLLE
The CPYSRCHDR command updates specific records and specific positions
within the standard header.
A user with *ALLOBJ special authority can modify the source in the
CPYSRCHDR source file in TAASECURE.. However, the first 8 lines
should remain as is because the command will update data at specific
relative record numbers and specific positions.
The standard header source is also shipped in the TAA Archive. If
you have changed the TAASECURE/CPYSRCHDR version and want to return
to the TAA Archive version, determine the member to copy and then do:
CPYTAA TAAARCMBR(xxx) TOSRCFILE(TAASECURE/CPYSRCHDR)
REPLACE(*YES)
CPYSRCHDR escape messages you can monitor for
---------------------------------------------
TAA9893 The member already exists for NEWMBR(*YES)
TAA9894 The member does not exist for NEWMBR(*NO)
TAA9895 The existing member does not have a text descrp
Escape messages from based on functions will be re-sent.
Command parameters *CMD
------------------
MBR The member name to be added. The member must not
exist for NEWMBR(*YES). The member must exist for
NEWMBR(*NO).
SRCTYP The source type of the member. The type must be one
of CMD, CL, CLP, CLLE, RPG, RPGLE, CBL, CBLLE, CLE,
PF, LF, DSPF, or PRTF.
The type becomes the source type of the member.
The source type also determines the name of the
source file if SRCFILE(*SRCTYP) is used. The
following describes the file names used:
QCMDSRC CMD
QCLSRC CL CLP CLLE
QRPGSRC RPG
QRPGLESRC RPGLE
QCBLSRC CBL
QCBLLESRC CBLLE
QCLESRC CLE
QDDSSRC PF LF DSPF PRTF
TEXT The member text of up to 50 bytes. A text
description must be entered for NEWMBR(*YES) and
cannot be *SAME. The text description must be *SAME
for NEWMBR(*NO).
SRCFILE The source file to add the member to or where the
member exists. The default is *SRCTYP (see the
SRCTYP parameter). The library qualifier defaults
to *LIBL. A specific name or *CURLIB may also be
used.
NEWMBR A *YES/*NO parameter for whether a new member is
being added. *YES is the default to add a new
member.
*NO must be specified when updating an existing
member.
Restrictions
------------
See the previous comments about modifying the standard headers.
Prerequisites
-------------
The following TAA Tools must be on your system:
FMTLIN Format line
SNDCOMPMSG Send completion message
SNDESCMSG Send escape message
WRTSRC Write source
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CPYSRCHDR *CMD TAASREH2 QATTCMD
TAASREHC2 *PGM CLP TAASREHC2 QATTCL
TAASREHC3 *PGM CLP TAASREHC3 QATTCL
TAASREH QATTCMD
TAASREHR QATTRPG
TAASREHP QATTDDS
|