Copy Job using Job Scheduler (CPYJOBJS)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Copy Job using Job Scheduler (CPYJOBJS) command allows you to copy a job or jobs and all its parameters to create a new job or jobs. You can copy the job on the same system or you can copy the job to a remote location name that you specify or you can copy the job to a different data library on the same system. After creating a new job, you can modify and change any or all of the associated parameters.

You can copy all jobs in a group to a new group that you specify. When copying a group, you must specify *ALL in the Job and Group sequence fields for the From job, and *SAME in the Job and Group sequence fields for the To job.

You can specify whether to copy dependencies, where you want to copy the job and what actions you should take when copying the job. You can print a report to analyze the effect of copying a job or jobs prior to processing the actual job copy.

Top

Parameters

Keyword Description Choices Notes
FROMJOB From job entry Element list Required, Positional 1
Element 1: Job Generic name, name, *ALL
Element 2: Group Generic name, name, *NONE, *ALL
Element 3: Group sequence 1-99, *NONE, *ALL
TOJOB To job entry Single values: *RMTLOCNAME, *DATALIB
Other values: Element list
Optional, Positional 2
Element 1: Job Name, *SAME
Element 2: Group Name, *SAME, *NONE
Element 3: Group sequence 1-99, *SAME, *NONE
CPYDEP Copy dependencies *NO, *YES Optional
RMTLOCNAME Remote location name Name Optional
DTALIB Data library Name Optional
APP Application Generic name, name, *ALL, *NONE Optional
ACTION Action *REPORT, *COPY Optional
ITMOPT Item options Element list Optional
Element 1: Job definition *ADD, *REPLACE
Element 2: Application *ADD, *REPLACE
Element 3: Calendar *ADD, *REPLACE
Element 4: Holiday calendar *ADD, *REPLACE
Element 5: Fiscal calendar *ADD, *REPLACE
Element 6: Library list *ADD, *REPLACE
Element 7: Parameters *ADD, *REPLACE
Top

From job entry (FROMJOB)

Specifies the name of the job schedule entry that you want to copy to create a new job. You must specify a job and alternately can specify a group to which the job belongs as well as a sequence number for the job within the group.

Note: Specifying a generic job name or *ALL is only valid when a remote location name is specified for the Remote location name (RMTLOCNAME) parameter or a data library is specified for the Data library (DTALIB) parameter. These parameters are available when specifying *RMTLOCNAME or *DATALIB, respectively, for the To job entry (TOJOB) Job parameter.

Note: If you are copying a group, you must specify *ALL for the job name, a single group name, and *ALL for the group sequence.

This is a required parameter.

Element 1: Job

*ALL
All jobs that meet that other parameters specified in the command are copied.
generic-name
Specify the generic name of the job. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. If the generic name is specified, then all entries with job names that begin with the generic name are displayed. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete job name.
name
Specify the user-defined name of the job schedule entry that you want to copy.

Element 2: Group

*NONE
The job is not assigned to a group.
*ALL
Copy all groups to which the job belongs.
generic-name
Specify the generic name of the group. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. If the generic name is specified, then all entries with group names that begin with the generic name are displayed. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete group name.
name
Specify the user-defined name of the group to which the job belongs.

Element 3: Group sequence

*NONE
There is not a sequence number assigned to the job.
*ALL
Copy all sequence numbers.
1-99
Specify the sequence number of the job within the group.
Top

To job entry (TOJOB)

Specifies the name of the job schedule entry that you are creating as a result of copying the job or jobs specified for the From job (FROMJOB) parameter. You must specify a job and alternately you can specify a group to which the job belongs as well as a sequence number for the job within the group.

Note: If you are copying a group, you must specify *SAME for the job name, a single group name and *SAME for the group sequence.

Single values

*RMTLOCNAME
The jobs are to be copied to the remote location name specified for the Remote location name (RMTLOCNAME) parameter.
*DATALIB
The jobs are to be copied to the data library specified for the Data library (DTALIB) parameter on the same system.

Element 1: Job

*SAME
The current name of the job does not change.
name
Specify the user-defined name of the job schedule entry that you want to create from the job that you are copying.

Element 2: Group

*SAME
The current name of the group does not change.
*NONE
The job is not a member of a group.
name
Specify the user-defined name of the group to which the job belongs.

Element 3: Group sequence

*SAME
The sequence number of the job does not change.
*NONE
There is not a sequence number assigned to the job.
1-99
Specify the sequence number of the job within the group.
Top

Copy dependencies (CPYDEP)

Specifies whether you should copy the dependencies from the job specified for the FROMJOB parameter to the job specified for the TOJOB parameter.

*NO
The job dependencies from the original job are not copied to the new job.
*YES
The job dependencies from the original job are copied to the new job.
Top

Remote location name (RMTLOCNAME)

Specifies the location and network identification of the system to which you are copying a job.

remote-location-name
Specify the name of the remote location associated with the system to which to copy the job.
network-ID.remote-location-name
Specify the network identifier and the name of the remote location associated with the system. Specify these values using the format nnnnnnnn.cccccccc where nnnnnnnn is the network identifier and cccccccc is the remote location name.
Top

Data library (DTALIB)

Specifies the data library to which you are copying a job.

name
Specify the name of the data library to which to copy the job.
Top

Application (APP)

Specifies the name of the application to which the job specified for the FROMJOB parameter belongs.

*ALL
Include all applications that contain jobs specified for the FROMJOB parameter.
*NONE
There is no application specified for this job.
generic-name
Specify the generic name of the application. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. If the generic name is specified, then all entries with application names that begin with the generic name are displayed. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete application name.
name
Specify the name of the application to which the job that you are copying belongs.
Top

Action (ACTION)

Specifies whether you want to create a Copy Job Remote report or perform an actual copy.

*REPORT
You want to create the Copy Job Remote Report. This is recommended prior to copying jobs to another system, particularly when using *ALL or a generic selection. The printer file for the report is QPIJS2CJ.
*COPY
You want to copy the requested jobs.
Top

Item options (ITMOPT)

Specify what action is to be taken for each item specified in the action list.

Element 1: Job definition

*ADD
Add the job definition for the job to which you are copying. If the job definition already exists, this job definition will not be copied.
*REPLACE
Add the job definition for the job to which you are copying. Replace the job definition if it already exists.

Element 2: Application

*ADD
Add the application for the job to which you are copying. If the application already exists, this application will not be copied.
*REPLACE
Add the application for the job to which you are copying. Replace the application if it already exists.

Element 3: Calendar

*ADD
Add the calendar for the job to which you are copying. If the calendar already exists, this calendar will not be copied.
*REPLACE
Add the calendar for the job to which you are copying. Replace the calendar if it already exists.

Element 4: Holiday calendar

*ADD
Add the holiday calendar for the job to which you are copying. If the holiday calendar already exists, this holiday calendar will not be copied.
*REPLACE
Add the holiday calendar for the job to which you are copying. Replace the holiday calendar if it already exists.

Element 5: Fiscal calendar

*ADD
Add the fiscal calendar for the job to which you are copying. If the fiscal calendar already exists, this fiscal calendar will not be copied.
*REPLACE
Add the fiscal calendar for the job to which you are copying. Replace the fiscal calendar if it already exists.

Element 6: Library list

*ADD
Add the library list for the job to which you are copying. If the library list already exists, this library list will not be copied.
*REPLACE
Add the library list for the job to which you are copying. Replace the library list if it already exists.

Element 7: Parameters

*ADD
Add the parameters for the job to which you are copying. If the parameters already exists, this parameters will not be copied.
*REPLACE
Add the parameters for the job to which you are copying. Replace the parameters if it already exists.
Top

Examples

Example 1: Copying a Job to a New Job

CPYJOBJS   FROMJOB(JOB02)  TOJOB(JOB03)  CPYDEP(*YES)

This command copies JOB02 to a new job called JOB03. The job dependencies from JOB02 are copied to JOB03.

Top

Error messages

Unknown
Top