• No results found

Example 2: Scratch and Uncatalog Two Data Sets

In document JCL Repository (Page 81-84)

In this example, two data sets are scratched: SET1 and A.B.C.D.E are scratched from volume 222222. Both data sets are uncataloged.

//SCRDSETS JOB ...

//STEP1 EXEC PGM=IEHPROGM

//SYSPRINT DD SYSOUT=A //DD1 DD UNIT=disk,VOLUME=SER=111111,DISP=OLD //DD2 DD UNIT=disk,DISP=OLD,VOLUME=SER=222222 //SYSIN DD * SCRATCH DSNAME=SET1,VOL=disk=222222 UNCATLG DSNAME=SET1 SCRATCH DSNAME=A.B.C.D.E,VOL=disk=222222 UNCATLG DSNAME=A.B.C.D.E /*

The utility control statements are discussed below:

• The first SCRATCH statement specifies that SET1, which resides on volume 222222, is scratched. • The first UNCATLG statement specifies that SET1 is uncataloged.

• The second SCRATCH statement specifies that A.B.C.D.E, which resides on volume 222222, is scratched. • The second UNCATLG statement specifies that A.B.C.D.E is uncataloged.

Example 3: Rename a Multi-Volume Data Set Cataloged in an CVOL

In this example, the name of a data set is changed on two mountable volumes. The old data set name is removed from the CVOL and the data set is cataloged under its new data set name.

//RENAMEDS JOB ...

//STEP1 EXEC PGM=IEHPROGM

//SYSPRINT DD SYSOUT=A //DD1 DD VOLUME=SER=111111,UNIT=disk,DISP=OLD //DD2 DD UNIT=(disk,,DEFER),DISP=OLD, // VOLUME=(PRIVATE,SER=(222222,333333)) //SYSIN DD * RENAME DSNAME=A.B.C,NEWNAME=NEWSET,VOL=disk=(222222,333333) UNCATLG DSNAME=A.B.C CATLG DSNAME=NEWSET,VOL=disk=(222222,333333) /*

The control statements are discussed below:

• RENAME specifies that data set A.B.C, which resides on volumes 222222 and 333333, is to be renamed NEWSET.

• UNCATLG specifies that data set A.B.C is uncataloged.

• CATLG specifies that NEWSET, which resides on volumes 222222 and 333333, is cataloged in the CVOL.

Example 4: Uncatalog Three Data Sets

In this example, three data sets--A.B.C.D.E.F.SET1, A.B.C.G.H.SET2, and A.B.I.J.K.SET3--are uncataloged.

//DLTSTRUC JOB ...

//STEP1 EXEC PGM=IEHPROGM

//SYSPRINT DD SYSOUT=A //DD1 DD UNIT=disk,VOLUME=SER=111111,DISP=OLD //SYSIN DD * UNCATLG DSNAME=A.B.C.D.E.F.SET1 UNCATLG DSNAME=A.B.C.G.H.SET2 UNCATLG DSNAME=A.B.I.J.K.SET3 /*

The control statements are discussed below:

• The UNCATLG statements specify that data sets A.B.C.D.E.F.SET1, A.B.C.G.H.SET2, and A.B.I.J.K.SET3 are uncataloged

Example 5: Rename a Data Set and Define New Passwords

In this example, a data set is renamed. The data set passwords assigned to the old data set name are deleted. Then two passwords are assigned to the new data set name. If the data set is not cataloged, a message is issued indicating that the LOCATE macro instruction ended unsuccessfully.

//ADDPASS JOB ...

//STEP1 EXEC PGM=IEHPROGM,PARM='NOPRINT'

//SYSPRINT DD SYSOUT=A //DD1 DD VOLUME=SER=222222,DISP=OLD, // UNIT=disk //SYSIN DD * RENAME DSNAME=OLD,VOL=disk=222222,NEWNAME=NEW DELETEP DSNAME=OLD,PASWORD1=KEY ADD DSNAME=NEW,PASWORD2=KEY,TYPE=1, DATA='SECONDARY IS READ'

ADD DSNAME=NEW,PASWORD2=READ,CPASWORD=KEY,TYPE=2, DATA='ASSIGNED TO J. DOE'

The utility control statements are discussed below:

• RENAME specifies that the data set called OLD is renamed NEW. The operator is required to supply a password to rename the old data set.

• DELETEP specifies that the entry for the password KEY is deleted. Because KEY is a control password in this example, all the password entries for the data set name are deleted. The VOL parameter is not needed because the protection status of the data set as set in the DSCB is not to be changed; read/write protection is presently set in the DSCB, and read/write protection is desired when the passwords are reassigned under the new data set name.

• The ADD statements specify that entries are added for passwords KEY and READ. KEY becomes the control password and allows both read and write access to the data set. READ becomes a secondary password and allows only read access to the data set. The VOL parameter is not needed, because the protection status of the data set is still set in the DSCB.

Example 6: List and Replace Password Information

In this example, information from a password entry is listed. Then the protection mode of the password, the protection status of the data set, and the user data are changed.

//REPLPASS JOB ...

//STEP1 EXEC PGM=IEHPROGM,PARM='NOPRINT'

//SYSPRINT DD SYSOUT=A //DD1 DD UNIT=disk,VOLUME=SER=111111,DISP=OLD //DD2 DD VOLUME=(PRIVATE,SER=(222222,333333)), // UNIT=(disk,,DEFER),DISP=OLD //SYSIN DD * LIST DSNAME=A.B.C,PASWORD1=ABLE REPLACE DSNAME=A.B.C,PASWORD1=ABLE,PASWORD2=ABLE,TYPE=3, VOL=disk=(222222,333333),

DATA='NO SECONDARIES; ASSIGNED TO DEPT 31' /*

The utility control statements are discussed below:

• LIST specifies that the access counter, protection mode, and user data from the entry for password ABLE are listed. Listing the entry permits the content of the access counter to be recorded before the counter is reset to zero by the REPLACE statement.

• REPLACE specifies that the protection mode of password ABLE is to be changed to allow both read and write access and that the protection status of the data set is changed to write-only protection. The VOL parameter is required because the protection status of the data set is changed and the data set, in this example, is not cataloged. Because this is a control password, the CPASWORD parameter is not required.

Example 7: Rename a Partitioned Data Set Member

In this example, a member of a partitioned data set is renamed.

//REN JOB ...

//STEP1 EXEC PGM=IEHPROGM

//SYSPRINT DD SYSOUT=A

//DD1 DD VOL=SER=222222,DISP=OLD,UNIT=disk

//SYSIN DD *

RENAME VOL=disk=222222,DSNAME=DATASET,NEWNAME=BC,MEMBER=ABC /*

The control statements are discussed below:

• DD1 DD defines a permanently mounted volume.

• RENAME specifies that member ABC in the partitioned data set DATASET, which resides on a disk volume, is renamed BC.

In document JCL Repository (Page 81-84)