- IEBCOPY is used to copy all or a part of PDs or PDSE. Basically Deals with PDS/PDSE
- IEBCOPY can be used to copy selected members to another PDS or the same PDS/PDSE and / or renamed.
- IEBCOPY can be used to copy PDS on a tape and vice versa. This may be used in case we need to backup the PDS.
- IEBCOPY can be used to load a PDS to a SMS managed PDSE. We can also copy PDSE to a PDS, but the application information stored in the directory of the PDSE will be lost.
- IEBCOPY can reblock load modules during copy operation.
- IEBCOPY is used to "compress" a PDS when all ofits unused internal space has been exhausted. The compress operation reorganizes a PDS so that all previously unused space inside the PDS is reclaimed.
Control Statements:
Valid control statements are:
- COPY
- ALTERMOD
- COPYMOD
- SELECT
- EXCLUDE
Control
statements are continued by placing a non-blank character in column 72 and
continuing the statement beginning in
column 16 on the next statement.
COPY statement:
Indicates
beginning of a COPY operation.
Identifies
the DD statements to be used for copy.
Format:
{label}
COPY OUTDD=ddname,
INDD=(ddname1,ddname2,(ddname3,R),...)
{,LIST=NO}
label : Is the name given to the control statement.
OUTDD : This is the name of the Output PDS.
INDD : This is the name of the input PDS.
The
LIST=NO keyword is optional and tells IEBCOPY that you don't want a list of the
members in the PDS.
COPY
can be abbreviated as 'C'
OUTDD
can be abbreviated as 'O'
INDD
can be abbreviated as 'I'.
R-->
When copying from a sequential file or a PDS to another PDS, specify the 'R'
parameter after the input DD name if you want ALL identically named members
replaced on the output file.
Identically
named members are only replaced on a copy operation if you request the REPLACE
option on the COPY statement, or on the SELECT statement.
Example:
- Copy with replace:
{label} COPY OUTDD=O,INDD=((I,R))
- Copy without replace:
{label} COPY OUTDD=TAPE,INDD=DASD.
Or
{label} C O=TAPE,I=DASD
- Compress in place: OUTDD and INDD should have same name for compression. Cannot use SELECT/EXCLUDE for this operation.
{label} COPY OUTDD=SYSUT1,INDD=SYSUT1
Select Statement:
Used
to select the members to be used for copy operation.
SELECT
statement should always be preceded by a COPY or COPYMOD operation.
SELECT
and EXCLUDE are mutually exclusive.
SELECT
cannot be used in a compress operation(when INDD and OUTDD are the same)
A
SELECT member is only replaced in the output data set if the REPLACE option
('R')is set on the SELECT statement or on the INDD portion of the COPY
statement.
Example:
- Copy selected member
{label} SELECT MEMBER =
Name
- Copy a list of members:
{label} SELECT
MEMBER=(name1,name2,name3)
- Copy the list of members and rename them
{label} SELECT
MEMBER=((name1,newname1),(name2,newname2),..)
- Copy the list of members and replace them if they are already present in output dataset
{label} SELECT
MEMBER=((name1,,R),(name2,,R),..)
Exclude Statement:
Used
to exclude members from a copy operation.
Exclude
statement must be preceded by a COPY or COPYMOD statement.
EXCLUDE
and SELECT are mutually exclusive.
EXCLUDE
cannot be used with compress Operation.
Format
is same as SELECT:
{label}
EXCLUDE MEMBER=(name1,name2,name3,...)
Example
1: Compression
BC00
SM017R.TEST1.JCL(IEBCOPY1) - 01.00 Columns 00001 00072
Command ===>
Scroll ===> CSR
****** ***************************** Top of
Data ******************************
000100 //IEBCOPY1 JOB (EWDS),'IEBCOPY
TEST',NOTIFY=&SYSUID
000200 //JS10 EXEC
PGM=IEBCOPY,REGION=1M
000300 //SYSPRINT DD SYSOUT=*
000400 //I1 DD DSN=SM017R.TEST.CTC,DISP=OLD --> Same name for
INDD and OUTDD
000500 //O1 DD DSN=SM017R.TEST.CTC,DISP=OLD
000600 //SYSIN DD *
000700 COMP1 C O=O1,I=((I1,R)) -->
C-COPY,O-OUTDD,I-INDD,R-REPLACE
000800 /*
****** **************************** Bottom
of Data ****************************
|
Example
2: JCL to unload
a PDS to tape
BC00 SM017R.TEST1.JCL(IEBCOPY1) -
01.01 Columns 00001 00072
Command
===>
Scroll ===> CSR
******
***************************** Top of Data ******************************
.JCPA //IEBCOPY1 JOB (EWDS),'IEBCOPY
TEST',NOTIFY=&SYSUID
000200
//JS10 EXEC PGM=IEBCOPY,REGION=1M
000300
//SYSPRINT DD SYSOUT=*
000400
//I1 DD
DSN=SM017R.TEST.CTC,DISP=OLD
000500
//O1 DD
DSN=SM017R.TEST.CTC.TAPE,DISP=(NEW,CATLG,DELETE),
000510
// UNIT=VTSTAPE
000600
//SYSIN DD *
000700
COMP1 C O=O1,I=((I1,R))
000800
/*
******
**************************** Bottom of Data ****************************
This
is used to save the PDS to a tape for later use or to copy from one system to
another.
|
Example 3: Just the copy 4 members from 1 PDS to
another
BC00 SM017R.TEST1.JCL(IEBCOPY1) -
01.02 Columns 00001 00072
Command
===>
Scroll ===> CSR
******
***************************** Top of Data ******************************
.JCPA //IEBCOPY1 JOB (EWDS),'IEBCOPY
TEST',NOTIFY=&SYSUID
000200
//JS10 EXEC PGM=IEBCOPY,REGION=1M
000300
//SYSPRINT DD SYSOUT=*
000400
//I1INPUT1 DD DSN=SM017R.TEST.CTC,DISP=OLD
000500 //O1OUTPUT DD DSN=SM017R.TEST.CTC1,DISP=SHR, --> Output PDS should exist
000510 //
UNIT=SYSDA
000600
//SYSIN DD *
000700
COMP1 COPY OUTDD=O1OUTPUT,INDD=((I1INPUT1,R))
000710
SEL1 SELECT MEMBER=(MLPTV015,MLPTV016)
000800
/*
******
**************************** Bottom of Data ****************************
Menu
Functions Confirm Utilities
Help
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
BC00
DSLIST SM017R.TEST.CTC1 Row 00001 of 00002
Command ===>
Scroll ===> CSR
Name Prompt Size
Created Changed ID
_________ MLPTV015 85 2011/12/29
2011/12/29 03:00:52 SM017R
_________ MLPTV016 63 2011/12/29
2011/12/29 02:57:49 SM017R
**End**
We
can see that only the two members got copied to the new PDS.
|
No comments:
Post a Comment