The CPYJOBLOG command copies a job log to a source member, strips out
the non-commands (only RQS messages are kept) and formats the source
in 71 byte increments.
The intent of this command is to allow the programmer to debug one or
more commands interactively from the command entry display and then
be able to copy the final version into a source member where the
commands can be used in a CL Program.
For example, assume you are debugging an OPNQRYF command with complex
selection and mapped field definitions. After several attempts, you
get the command to work the way you want. Now you want to capture
the command which is on the command entry display and place it in a
source member so that a CL program can be used. Rather than
re-keying the entire command, you could use the CPYJOBLOG command and
copy your current job log into a designated source member.
Another example is where you are using the PRTDBF command (part of
the CRTPRTPGM TAA Tool) with the FIELD(*YES) prompt and have used
several iterations to arrange the report with control levels and a
title to reflect the desired results. The FIELDS(*YES) option
returns a RQS type message to the command entry display with the
fields in the sequence you have requested. Thus you can now pick up
the completed prompted result and place it into a CL program.
The typical use of the command would be:
CPYJOBLOG MBR(SOURCE1)
The command processing program retrieves the information about your
current job including the time of the request and either submits a
batch job or does the copy during the current job. The default is to
submit a batch job.
The processing program issues the DSPJOBLOG command and then extracts
and formats the information into a source member. The default source
file is QCLSRC. The default is to extract the commands (request
messages) you have issued in the last 5 minutes. Commands (whether
they were successfully executed or not) are copied. Certain commands
(e.g. CPYJOBLOG) are excluded.
If you have specified LOGCLPGM(*YES), the commands from CL programs
will be logged to the job log as type CMD. These are ignored since
they are not of the RQS type.
The commands (i.e. RQS messages) are added to the source member. An
option controls whether the member is cleared first. If the member
does not exist, it is added.
The first record written contains information from the job that
issued CPYJOBLOG and the date and time it was run.
You will normally need to modify the source member such as:
** Deleting commands you are not interested in
** Using the prompter on the commands you want to keep in order
to better format them in your source
** Adding new commands to make a complete CL program.
CPYJOBLOG can also be used against a job that has completed execution
(assuming the job log still exists on the system).
When *ALL is not specified for NBRMINS, the retrieving of commands is
based on time stamps in the job log. With the new job log format
(V2R3), all of the messages in the job log are timestamped so all
commands are retrieved.
If the job is submitted to batch for the job log of the current job,
it may not run until the submitting job is completed. The job log
must still exist to allow the copy to work successfully.
Restrictions
------------
** If a batch job is submitted for the current job, the job log
must exist on the system when the batch program executes.
This can occur by either the job still being active or a
completed job log on a spooled file.
** Because the CPYJOBLOG command uses the printed format from
DSPJOBLOG, the command is release dependent. Only the lower
and upper case English language versions are supported. If
the printed format changes, the program to read the printed
output may have to be changed.
** Some functions executed from the Programmer Menu will be not
be executable as commands (same restriction occurs if you try
to execute the logged command from the command entry display).
Command parameters *CMD
------------------
MBR The source member that will be used. If it does not
exist, it will be added. If there are existing
source records, the new records are added at the
end. The source sequence number is incremented by
1.00 for each record.
SRCFILE The source file name. It defaults to QCLSRC. The
library qualifier defaults to *LIBL.
JOB The qualified job name to be used for the job log.
The default is * meaning to use DSPJOBLOG on the
current job. if the job has already been completed
and the job exists, a CPYSPLF command will be used
directly against the job log.
NBRMINS The number of minutes prior to the current time that
you want to capture commands for. The default is 5
minutes meaning that commands attempted in the last
5 minutes (as measured from the time you submit the
command) will appear in the source member. *ALL may
be specified for the entire job log.
REPLACE A *YES/*NO value for whether the member should be
cleared before writing records into it. The default
is *NO.
SBMJOB A *YES/*NO value for whether the job should be
submitted to batch to perform the copy. *YES is the
default causing a batch job. *NO causes the
function to be run in the current job.
JOBQ The qualified name of the job queue to be used to
submit the batch job to. The default is *JOBD which
means the current attribute for the job is used.
Prerequisites
-------------
The following TAA Tools must be on your system.
ADDTIM Add number of minutes to a time
RTVDAT Retrieve date
RTVTIMSTM Retrieve time stamp
SNDCOMPMSG Send completion message
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
------ ----- --------- ---------- -----------
CPYJOBLOG *CMD TAASPLA QATTCMD
TAASPLAC *PGM CLP TAASPLAC QATTCL
TAASPLAC2 *PGM CLP TAASPLAC2 QATTCL
TAASPLAR *PGM RPG TAASPLAR QATTRPG
Structure
---------
CPYJOBLOG Command
TAASPLAC CL pgm submits TAASPLAC2 CL pgm
TAASPLAR RPG pgm
|