File dumping and restoring

From m204wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Overview

The DUMP and RESTORE commands copy file pages from one data set to another. This page describes the DUMP and RESTORE commands and provides examples of a number of their applications.

The DUMP and RESTORE commands are by no means the only way to make backups and copies of Model 204 files. The normal data set backup/restore/copy techniques in use at your site are almost certainly usable against Model 204 files. However, these techniques require exclusive access to the files. Either the files cannot be in any other job while the backup/restore/copy is run, or the job using the files must be quiesced (using the EXTENDED QUIESCE option on the CHECKPOINT command).

DUMP and RESTORE commands

  • The Model 204 DUMP command "takes a snapshot" of a Model 204 file at a particular time to create a backup copy of the data.
  • Using this copy, the RESTORE command returns the file to its exact state at the time the DUMP was taken.

The Model 204 DUMP/RESTORE facility allows you to perform the following functions on one or more files:

  • These functions can be done with any backup technique:
    • Recover from disk crashes, operating system crashes, accidentally scratched data sets, and sabotage
    • Move a Model 204 file from one device to another
  • These functions can only be done with the dump/restore:
    • Change the number and size of a file's data sets
    • Rename the file
    • Rearrange file pages after using an INCREASE command
    • Move all file pages into one (larger) data set after an INCREASE DATASETS command.

However, because the DUMP and RESTORE commands do not reorganize the content in any way, they cannot be used to change the file parameters or field attributes or to compact the file.

DUMP and RESTORE product options

The Fast/Backup product provides a plug-compatible replacement for the the DUMP and RESTORE commands. When installed, this product dramatically increases the performance of these commands.

See DUMP and DUMPX and RESTORE and RESTOREX as well as the Fast/Backup User's Guide for more information.

Combining DUMP and RESTORE functions

You can combine many of these functions in a single DUMP and RESTORE run; that is, you can move a file to a new device, resize it, and rename it in a single series of DUMP and RESTORE steps.

Using DUMP and RESTORE with media recovery

If your site uses media recovery to recover files in the event of a media failure, such as a disk head crash, be sure to dump all Model 204 files on a regular basis. In addition, ensure that journals are produced for runs that update files between dumps.

When a dump is taken, Model 204 records the time and date on both the dump data set and the journal data set (if journaling is active). When media recovery is performed, the starting point in the journal for reapplying updates to a file is the first update that occurs after the time and date of the dump data set. (See Tracking system activity (CCAJRNL, CCAAUDIT, CCAJLOG) for information about journaling, and also see the description of the REGENERATE command.)

Dumping files

The DUMP command makes a copy of an open Model 204 file on a sequential data set. This data set can be on either a magnetic tape or a direct access device.

When you enter the DUMP command:

  1. DUMP waits until all existing transactions that might update the file have completed and the existing copy of the file is in a consistent state.
  2. Model 204 dumps the file.
  3. If, while the dump is being taken, a subsequent user request updates the file being dumped, Model 204 dumps preimages of database pages to be updated before the update is allowed. This guarantees that the dumped copy matches the state of the file at the time DUMP began.

Syntax

The format of the DUMP command is:

DUMP TO dumpfile

Where:

dumpfile is the dump file name.

When the DUMP command is issued, it must wait for all updating transactions to complete before it can begin. If a file is being updated, the following message is displayed:

DUMP TO dumpfile *** M204.0602: FILE IS IN USE *** M204.1076: DO YOU REALLY WANT TO TRY AGAIN?

If you reply with Y (yes), Model 204 tries again to enqueue the file. If you reply with N (no), Model 204 does not try again to enqueue the file, but returns control to you so that you can issue another command. The default response is N.

When the dump begins, Model 204 displays the following message:

*** M204.1760: FILE filename: DUMP BEGINNING at hh:mm:ss

This information also appears on the audit trail.

If DUMP cannot begin for an extended period of time, you can cancel the command in response to the "DO YOU REALLY WANT TO?" message.

If the dump completes without errors, the following message is displayed:

*** M204.1761: FILE filename: DUMP COMPLETED AT hh:mm:ss

Setting up the DUMP/RESTORE utility

Because dumps are often done in batch runs, the BATCH204 module contains the DUMP/RESTORE utility. In addition to the normal JCL or EXEC that the system manager supplies to run BATCH204, the DUMP command requires a DD statement or FILEDEF for the dump file.

Naming DUMP files

Although you can choose any file name, a name that begins with DUMP is usually used.

DUMP command usage notes

The DUMP command works only in file context, and file manager privileges are required for its use.

The file to be dumped must be opened before issuing DUMP, and then must be closed after DUMP completes.

Errors during file dumps

If errors are detected during the file dump, the dump ends and the following message is displayed:

*** M204.1762: FILE filename: DUMP ENDED ABNORMALLY

Other users of the file are unaffected by DUMP errors and not forced to wait.

Dumping multiple files

More than one Model 204 file can be dumped in one run. Include a DD statement or FILEDEF for each file and for each dump file. Each file can be opened and dumped in turn. Including a CLOSE command after each DUMP prevents overrunning the NFILES parameter. In addition, the CLOSE ensures that one file is not accidentally dumped twice if the subsequent OPEN fails. For example:

OPEN PEOPLE DUMP TO DUMPPEOP CLOSE PEOPLE OPEN CARS DUMP TO DUMPCARS CLOSE CARS

If an error is detected during a DUMP command, the Model 204 job step return code is set to 20.

z/OS considerations

Under the z/OS operating system, the dump file DD statement must contain the following parameters:

  • DSNAME
  • DISP
  • UNIT
  • VOLUME

If the data set is on tape, you can use the LABEL parameter.

If the data set is on disk, the SPACE parameter must be present and set equivalent to the amount of space occupied by the Model 204 file.

Omit DCB information unless your site uses blocking as discussed in Blocking DUMP data sets.

Blocking DUMP data sets

DUMP data sets can be blocked. In z/OS, specify a BLKSIZE entry in the DCB parameter in the DD statement. The specified block size must be a multiple of 6184 (that is, PAGESZ). If it is not, Model 204 rounds the block size down to the next multiple of 6184.

As of version 7.5, if the BLKSIZE is zero or is not specified, the z/OS operating system calculates the optimal BLKSIZE. In version 7.4 and earlier, if the BLKSIZE is zero or is not specified, 6184 is used as the default block size.

z/OS example

For example, the following z/OS job step dumps the PEOPLE file to a tape:

//EXEC Include here the basic JCL or cataloged procedure invocation provided by the Model 204 system manager to run BATCH204 //PEOPLE DD DSN=M204.FILE.PEOPLE,DISP=SHR //DUMPPEOP DD DSN=M204.DUMP.PEOPLE, // DISP=(NEW,CATLG,DELETE),UNIT=TAPE, // VOLUME=SER=T12345 //CCAIN DD * PAGESZ=6184 OPEN PEOPLE DUMP TO DUMPPEOP CLOSE PEOPLE EOJ /*

z/VM example

The following z/VM EXEC, DUMPPEOP, assumes that the tape used has already been labeled. To run the EXEC in ONLINE, enter:

ONLINE BYPASS DUMPPEOP

The DUMPPEOP EXEC follows:

&CONTROL OFF FILEDEF * CLEAR FILEDEF CCASNAP PRINTER FILEDEF CCATEMP DISK CCATEMP WORK A ( XTENT 20 LRECL 6184 FILEDEF CCAPRINT DISK DUMPPEOP CCAPRINT A FILEDEF CCAAUDIT DISK DUMPPEOP CCAAUDIT A FILEDEF DUMPPEOP TAP1 SL VOLID 123456 LABELDEF DUMPPEOP VOLID 123456 FILEDEF PEOPLE M DSN M204 FILE PEOPLE FILEDEF CCAIN DISK DUMPPEOP CCAIN * &STACK SYSOPT 128 LIBUFF 600

Sample z/VM CCAIN stream

The DUMPPEOP CCAIN input contains:

PAGESZ=6184 OPEN PEOPLE DUMP TO DUMPPEOP CLOSE PEOPLE EOJ

z/VSE considerations

Any dump data sets that are to be referenced by the DUMP or RESTORE commands must be described in the batch or Online JCL stream with DLBL and EXTENT statements if they are to be disk resident, or with a TLBL statement if the dump data set is to be on magnetic tape.

The file name used for a disk dump data set must be the same as the dump file name referenced in the DUMP command. That is, if the command DUMP TO DUMPTST is issued to the batch or Online program, a DLBL for file name DUMPTST must be included in the JCL.

If you want to place the dump data set on tape, issue a DEFINE DATASET command before the DUMP command to establish the relationship between the dump file referenced in the DUMP command and the file name used on the TLBL statement.

Dump data set characteristics

The default characteristics of the dump data set are:

Characteristic Value
Logical record length 6184 (value of Model 204 PAGESZ parameter)
Physical block size 6184
Record format Fixed blocked

The only parameter that can be overridden with the DEFINE DATASET command is the physical block size. To alter the block size, issue the DEFINE DATASET command before the DUMP or RESTORE command.

Positioning the tape

These commands do not perform any tape positioning. Position the tape through the MTC (Magnetic Tape Command) JCL statement in the startup JCL for the batch or Online program.

z/VSE example

The following example of the DUMP command is used to dump to tape:

// JOB ONLINE WITH TAPE DUMP . . . // TLBL SYS006,'M204.DUMP.PEOPLE' // ASSGN SYS006,X'cuu' // DLBL PEOPLE,'M204.DATABASE.TO.DUMP',,DA // EXTENT SYS005 // EXEC ONLINE,SIZE=AUTO user zero parameters LOGIN userid password OPEN PEOPLE DEFINE DATASET DUMPPEOP WITH SCOPE=SYSTEM DDNAME=SYS006 DUMP TO DUMPPEOP CLOSE ALL EOJ /* /&

Restoring files

The RESTORE command takes the sequential data set produced by a DUMP command and turns it back into a Model 204 file. The BATCH204 module normally is used in a batch run, and the JCL or EXEC must include data set or file definition statements for the data sets of the Model 204 file and the dump data set.

Syntax

The format of the RESTORE command is:

RESTORE [options] FROM name

Where:

  • options are expressed as a decimal number. The RESTORE options are as follows:
    Option Meaning
    128 Size of a file data set or the number of data sets in a file is being changed.
    192 Name of a file is being changed.
  • name is the dump data set or dump file name from which the Model 204 file is being restored.

Usage

A private or semipublic file is automatically closed after being restored. Public files remain open.

The RESTORE command can be issued from within a procedure.

Informational and error messages

Messages inform you when the RESTORE begins and ends. If an error is detected during a RESTORE command, the Model 204 job step return code is set to 20.

Restoring to original data sets

In the event of a system crash or inadvertently administered file updates (for example, a user accidentally initializes a file), you might want to restore the file to its state at the time of the last dump.

If the file's data sets are still in the same location and have not been damaged physically, you can open the file and use RESTORE FROM name without specifying any options.

z/OS example

//EXEC Include here the basic JCL or cataloged procedure invocation provided by the Model 204 system manager to run BATCH204. //PEOPLE DD DSN=M204.FILE.PEOPLE,DISP=SHR //DUMPPEOP DD DSN=M204.DUMP.PEOPLE, // DISP=OLD,UNIT=TAPE,VOLUME=SER=T12345 //CCAIN DD * PAGESZ=6184 OPEN PEOPLE RESTORE FROM DUMPPEOP EOJ /*

z/VSE example

//JOB BATCH204 RESTORE FROM TAPE DUMP . . . // TLBL SYS006,'M204.DUMP.PEOPLE' // ASSGN SYS006,X'cuu' // DLBL PEOPLE,'M204.RESTORE.FROM.DUMP',,DA // EXTENT SYS005 // EXEC BATCH204,SIZE=AUTO user zero parameters LOGIN userid password OPEN PEOPLE DEFINE DATASET DUMPPEOP WITH SCOPE=SYSTEM DDNAME=SYS006 RESTORE FROM DUMPPEOP CLOSE ALL EOJ /* /&

z/VM example

For z/VM, using the dump file (DUMPPEOP) created in the z/VM example on z/VM example, a RESTORE EXEC follows. Issue the command ONLINE BYPASS RESTORE to invoke the following EXEC:

&CONTROL OFF FILEDEF * CLEAR FILEDEF CCASNAP PRINTER FILEDEF CCATEMP DISK CCATEMP WORK A ( XTENT 20 LRECL 6184 FILEDEF CCAPRINT DISK RESTPEOP CCAPRINT A FILEDEF CCAUDIT DISK RESTPEOP CCAAUDIT A FILEDEF DUMPPEOP TAP1 SL VOLID 123456 LABELDEF DUMPPEOP VOLID 123456 FILEDEF PEOPLE M DSN M204 FILE PEOPLE FILEDEF CCAIN DISK RESTPEOP CCAIN * &STACK SYSOPT 128 LIBUFF 600

where the RESTPEOP CCAIN input contains:

PAGESZ=6184 OPEN PEOPLE RESTORE 128 FROM DUMPPEOP CLOSE PEOPLE EOJ

Restoring to new data sets

If one or more file data sets are physically damaged by a disk crash or are accidentally overwritten, you might need to reallocate the data sets and restore the file. Follow these steps:

  1. Reallocate the data sets with exactly the same number of pages that they had originally. (If the size of a data set must be changed, see Changing the size or number of file data sets.)
  2. Re-create the file. The CREATE command properly formats the tracks of the new data set. Without the CREATE, RESTORE can cause a TROUBLE WITH DISK I/O error message to appear.

    Let parameters default to their default values. RESTORE resets all parameters to their dumped values.

    To skew files, specify the X'40' bit of the FILEORG parameter with the CREATE command.

  3. Open and restore the file with the 128 option. The syntax for the 128 option is:

    RESTORE 128 FROM ddname

z/OS example

In the following z/OS example, a two-data set file, CARS, has its data sets reallocated:

//EXEC PGM=BATCH204 //CARS DD DSN=M204.FILE.CARS,DISP=SHR //CARS2 DD DSN=M204.FILE.CARS2,DISP=SHR //DUMPCARS DD DSN=M204.DUMP.CARS,DISP=OLD, // UNIT=TAPE,VOL=SER=987654 //CCAIN DD * PAGESZ=6184 CREATE FILE CARS FROM CARS,CARS2 END OPEN CARS RESTORE 128 FROM DUMPCARS EOJ /*

z/VSE example

// JOB RESTORE FILE CARS . . . // DLBL CARS,'M204.FILE.CARS',,DA // EXTENT ,volser // DLBL CARS2,'M204.FILE.CARS2',,DA // EXTENT ,volser // TLBL SYS010,'M204.DUMP.CARS' // ASSGN SYS010,X'300' // DLBL CCASTAT,'M204.CCASTAT' // EXTENT ,volser // UPSI 10010000 // EXEC BATCH204,SIZE=AUTO PAGESIZE=6184 LOGIN userid password DEFINE DATASET DUMPCARS WITH SCOPE=SYSTEM FILENAME=SYS010 CREATE FILE CARS FROM CARS,CARS2 END OPEN CARS RESTORE 128 FROM DUMPCARS EOJ /* /&

z/VM example

For z/VM, run the following NEWCARS EXEC by entering the following command:

ONLINE BYPASS NEWCARS

The NEWCARS EXEC and its associated CCAIN input follow:

&CONTROL OFF FILEDEF CLEAR * FILEDEF CCASNAP PRINTER FILEDEF CCATEMP DISK CCATEMP WORK (XTENT 20 LRECL 6184 FILEDEF CCASTAT M DSN WORK CCASTAT FILEDEF CCAPRINT DISK NEWCARS CCAPRINT A FILEDEF CCAAUDIT DISK NEWCARS CCAAUDIT A FILEDEF DUMPCARS TAP1 SL VOLID 123456 LABELDEF DUMPCARS VOLID 123456 FILEDEF CARS M DSN M204 FILE CARS FILEDEF CARS2 M DSN M204 FILE CARS2 FILEDEF CCAIN DISK NEWCARS CCAIN A &STACK SYSOPT 128 LIBUFF 600

The NEWCARS CCAIN file contains:

PAGESIZE=6184 LOGIN userid password CREATE FILE CARS FROM CARS,CARS2 END OPEN CARS RESTORE 128 FROM DUMPCARS EOJ

Moving Model 204 files

In most cases, use the Model 204 DUMP/RESTORE utility to move Model 204 files. Remember that you can combine DUMP and RESTORE functions; for example, you can move files to new data sets and resize them in the same set of steps.

The instructions for moving files with the Model 204 DUMP/RESTORE utility follow.

When can you use IBM move and copy utilities?

You can use the IBM utilities (IEHMOVE and IEBGENER for z/OS users, or a copy utility such as DITTO for z/VSE users) except when a skewed file is being moved to a different device type.

If you use a non-Model 204 utility to move a skewed file from one device type to another (for example, from a 3350 to a 3380) you will not be able to open the file.

Under the same limitations you can also use the IBM utility DFDSS, if you specify ALLEXCP and do not specify TOL(ENQF).

Using DUMP and RESTORE to move files

Follow these steps to use DUMP/RESTORE to move files:

  1. Allocate new data set(s) for the file. Ensure that the number of data sets does not change and that each new data set has the same number of pages as the corresponding old data set. (See Changing the size or number of file data sets for more information.)
  2. Dump the file to a dump data set or dump file using data set or file definition statements pointing to the old data sets or files.
  3. Execute a separate job step with the new data sets or files, recreating the file and restoring from the dump data set or dump file. Unless the FILEORG parameter X'40' bit is turned on along with the CREATE command prior to the RESTORE, restored files are not skewed. The DD, DLBL, or FILEDEF names for the file must be identical to the old ones.

z/OS example

For z/OS, the following job moves a three-data set file:

//EXEC PGM=BATCH204 //PARTS DD DSN=M204.FILE.PARTS,DISP=SHR //PARTS2 DD DSN=M204.FILE.PARTS2,DISP=SHR //PARTS3 DD DSN=M204.FILE.PARTS3.DISP=SHR //DUMPPART DD DSN=M204.DUMP.PARTS,DISP=(NEW,PASS), // UNIT=TAPE, VOL=SER=T00001 //CCAIN DD * user zero parameters OPEN PARTS DUMP TO DUMPPART CLOSE ALL EOJ /* //EXEC PGM=BATCH204 //PARTS DD DSN=M204.FILE.NEWPARTS,DISP=SHR //PARTS2 DD DSN=M204.FILE.NEWPARTS2,DISP=SHR //PARTS3 DD DSN=M204.FILE.NEWPARTS3,DISP=SHR //DUMPPART DD DSN=M204.DUMP.PARTS,DISP=(OLD,KEEP), // UNIT=TAPE,VOL=SER=T00001 //CCAIN DD * user zero parameters CREATE FILE PARTS FROM PARTS,PARTS2,PARTS3 END OPEN PARTS RESTORE 128 FROM DUMPPART CLOSE ALL EOJ /*

z/VSE example

// JOB MOVE FILE PARTS . . . // DLBL PARTS,'M204.FILE.PARTS',,DA // EXTENT ,volser // TLBL SYS010,'M204.DUMP.PARTS' // ASSGN SYS010,X'300' // DLBL CCASTAT,'M204.CCASTAT' // EXTENT ,volser // UPSI 10010000 // EXEC BATCH204,SIZE=AUTO user zero parameters LOGIN userid password DEFINE DATASET DUMPPART WITH SCOPE=SYSTEM FILENAME=SYS010 OPEN PARTS DUMP TO DUMPPART CLOSE ALL EOJ /* . . . // DLBL PARTS,'M204.FILE.NEWPARTS',,DA // EXTENT ,volser // TLBL SYS010,'M204.DUMP.PARTS' // ASSGN SYS010,X'300' // DLBL CCASTAT,'M204.CCASTAT' // EXTENT ,volser // UPSI 10010000 // EXEC BATCH204,SIZE=AUTO user zero parameters LOGIN userid password DEFINE DATASET DUMPPART WITH SCOPE=SYSTEM FILENAME=SYS010 CREATE FILE PARTS END OPEN PARTS RESTORE 128 FROM DUMPPART CLOSE ALL EOJ /* /&

z/VM example

In z/VM, with the previously allocated and created PARTS, PARTS2, and PARTS3 files and dump file M204.DUMP.PARTS, use the DUMPPART EXEC to dump PARTS into the dump file by using the following command:

ONLINE BYPASS DUMPPART

The DUMPPART EXEC follows:

&CONTROL OFF FILEDEF * CLEAR FILEDEF CCASNAP PRINTER FILEDEF CCATEMP DISK CCATEMP WORK A ( XTENT 20 LRECL 6184 FILEDEF CCAPRINT DISK DUMPPART CCAPRINT A FILEDEF CCAAUDIT DISK DUMPPART CCAAUDIT A FILEDEF DUMPPART TAP1 SL VOLID 123456 LABELDEF DUMPPART VOLID 123456 FILEDEF PARTS M DSN M204 FILE PARTS FILEDEF PARTS2 M DSN M204 FILE PARTS2 FILEDEF PARTS3 M DSN M204 FILE PARTS3 FILEDEF CCAIN DISK DUMPPART CCAIN A &STACK SYSOPT 128 LIBUFF 600

where the DUMPPART CCAIN input contains:

PAGESZ=6184 OPEN PARTS DUMP TO DUMPPART CLOSE PARTS EOJ

Then re-create and restore PARTS from the dump file using the RESTPART EXEC invoked by the following command:

ONLINE BYPASS RESTPART

The RESTPART EXEC follows:

&TRACE OFF FILEDEF * CLEAR FILEDEF CCASNAP PRINTER FILEDEF CCATEMP DISK CCATEMP WORK A ( XTENT 20 LRECL 6184 FILEDEF CCAPRINT DISK RESTPART CCAPRINT A FILEDEF CCAUDIT DISK RESTPART CCAAUDIT A FILEDEF DUMPPART TAP1 SL VOLID 123456 LABELDEF DUMPPART VOLID 123456 FILEDEF PARTS M DSN M204 FILE PARTS FILEDEF PARTS2 M DSN M204 FILE PARTS2 FILEDEF PARTS3 M DSN M204 FILE PARTS3 FILEDEF CCAIN DISK RESTPART CCAIN A &STACK SYSOPT 128 LIBUFF 600

where the RESTPART CCAIN input contains:

PAGESZ=6184 CREATE FILE PARTS FROM PARTS,PARTS2,PARTS3 END OPEN PARTS RESTORE 128 FROM DUMPPART CLOSE PARTS EOJ

Changing the size or number of file data sets

The RESTORE command allows you to change the size of a file data set or the number of data sets in the file. (You can also use the INCREASE command to add data sets to the file.

To change the size or number of file data sets:

  1. Dump the file as it currently exists.
  2. Allocate or reallocate the desired data sets. The total number of pages in the file can increase or decrease, but they must not be less than the sum of the current values of the parameters: 8 + ASIZE + BSIZE + CSIZE + DSIZE

    The values of these parameters cannot be changed with DUMP/RESTORE. BSIZE and DSIZE, however, can be changed with the INCREASE and DECREASE commands. All changes in the total number of pages allocated are reflected in the viewable parameter FREESIZE, which indicates the number of unassigned pages.

  3. Run a job step that includes data set or file definition statements for the new data sets. This job re-creates the file from the new data sets, opens the file, and restores it from the dump data set, specifying the option 128 (that is, RESTORE 128 FROM name).

z/OS example

For example, the CENSUS file consists of five data sets, but you can consolidate them to one, reducing the number of data set or file definition statements required when using the file:

//JOB CONSOLIDATE CENSUS FILES //EXEC... //CENSUS DD DSN=M204.FILE.CENFCT,DISP=SHR //CENA DD DSN=M204.FILE.CENSUSA,DISP=SHR //CENB DD DSN=M204.FILE.CENSUSB,DISP=SHR //CENC DD DSN=M204.FILE.CENSUSC,DISP=SHR //CEND DD DSN=M204.FILE.CENSUSD,DISP=SHR //DUMPCEN DD DSN=M204.DUMP.CENSUS, // DISP=(NEW,PASS),UNIT=TAPE,VOL=SER=ABCDEF //CCAIN DD * user zero parameters OPEN CENSUS DUMP TO DUMPCEN CLOSE ALL EOJ /* // EXEC... //CENSUS DD DSN=M204.FILE.CENSUS, // DISP=(NEW,CATLG),UNIT=2314, // VOL=SER=ABCDEF // SPACE=(TRK,543,,CONTIG) //DUMPCEN DD DSN=M204.DUMP.CENSUS,DISP=(OLD,KEEP), // UNIT=TAPE,VOL=SER=ABCDEF //CCAIN DD * user zero parameters CREATE FILE CENSUS END OPEN CENSUS RESTORE 128 FROM DUMPCEN CLOSE ALL EOJ /*

z/VSE example

// JOB CONSOLIDATE FILE CENSUS . . . // DLBL CENSUS,'M204.FILE.CENFCT',,DA // EXTENT ,volser // DLBL CENA,'M204.FILE.CENSUSA',,DA // EXTENT ,volser // DLBL CENB,'M204.FILE.CENSUSB',,DA // EXTENT ,volser // DLBL CENC,'M204.FILE.CENSUSC',,DA // EXTENT ,volser // DLBL CEND,'M204.FILE.CENSUSD',,DA // EXTENT ,volser // TLBL SYS010,'M204.DUMP.CENSUS' // ASSGN SYS010,X'300' // DLBL CCASTAT,'M204.CCASTAT' // EXTENT ,volser // UPSI 10010000 // EXEC BATCH204,SIZE=AUTO user zero parameters LOGIN userid password DEFINE DATASET DUMPCEN WITH SCOPE=SYSTEM FILENAME=SYS010 OPEN CENSUS DUMP TO DUMPCEN CLOSE ALL EOJ /* . . . // DLBL CENSUS,'M204.FILE.CENSUS',,DA // EXTENT ,volser // TLBL SYS010,'M204.DUMP.CENSUS' // ASSGN SYS010,X'300' // DLBL CCASTAT,'M204.CCASTAT' // EXTENT ,volser // UPSI 10010000 // EXEC BATCH204,SIZE=AUTO user zero parameters LOGIN userid password DEFINE DATASET DUMPCEN WITH SCOPE=SYSTEM - FILENAME=SYS010 CREATE FILE CENSUS END OPEN CENSUS RESTORE 128 FROM DUMPCEN CLOSE ALL EOJ /* /&

z/VM example

For z/VM, allocate the CENSUS file using the following command:

M204UTIL ALLOCATE M204 FILE CENSUS M (PRIMARY 543 TRK

Run the DUMPCENS EXEC to dump the CENSUS file by entering the following command:

ONLINE BYPASS DUMPCENS

The DUMPCENS EXEC follows:

&CONTROL OFF FILEDEF CLEAR * FILEDEF CCASNAP PRINTER FILEDEF CCATEMP DISK CCATEMP WORK ( XTENT 20 LRECL 6184 FILEDEF CCASTAT M DSN WORK CCASTAT FILEDEF CCAPRINT DISK DUMPCENS CCAPRINT A FILEDEF CCAAUDIT DISK DUMPCENS CCAAUDIT A FILEDEF CENSUS M DSN M204 FILE CENFCT FILEDEF CENA M DSN M204 FILE CENSUSA FILEDEF CENB M DSN M204 FILE CENSUSB FILEDEF CENC M DSN M204 FILE CENSUSC FILEDEF CEND M DSN M204 FILE CENSUSD FILEDEF DUMPCEN TAP1 SL VOLID 123456 LABELDEF DUMPCEN VOLID 123456 FILEDEF CCAIN DISK DUMPCENS CCAIN A &STACK SYSOPT 128 LIBUFF 600

where the CCAIN file, DUMPCENS CCAIN, is:

PAGESZ=6184 OPEN CENSUS DUMP TO DUMPCEN EOJ

Run the RESTCENS EXEC, the EXEC to restore the CENSUS file, by entering:

ONLINE BYPASS RESTCENS

The RESTCENS EXEC follows:

&CONTROL OFF FILEDEF CLEAR * FILEDEF CCASNAP PRINTER FILEDEF CCATEMP DISK CCATEMP WORK ( XTENT 20 LRECL 6184 FILEDEF CCASTAT M DSN WORK CCASTAT FILEDEF CCAPRINT DISK RESTCENS CCAPRINT A FILEDEF CCAAUDIT DISK RESTCENS CCAAUDIT A FILEDEF CENSUS M DSN M204 FILE CENSUS FILEDEF DUMPCEN TAP1 SL VOLID 123456 LABELDEF DUMPCEN VOLID 123456 FILEDEF CCAIN DISK RESTCENS CCAIN A &STACK SYSOPT 128 LIBUFF 600

where the CCAIN file, RESTCENS CCAIN, is:

CREATE FILE CENSUS END OPEN CENSUS RESTORE 128 FROM DUMPCEN EOJ

Renaming a file

The RESTORE command allows you to change the name of a Model 204 file. The name cannot be changed simply by changing the DD or DLBL name, or the FILEDEF of the first data set of the file. The renaming operation can be done in one job step with a temporary dump data set.

Data set or file definition statements must be included with the old names pointing to the file's data sets. Data set or file definition statements also must be included with the new names pointing to the same data sets. The file is opened under its old name and dumped to the temporary dump data set. The file is then closed.

Next, create a file containing the new name, open it, and specify:

RESTORE 192 FROM name

In the following examples, the CARS file is renamed AUTOS.

z/OS example

//JOB RENAME FILE CARS // EXEC PGM=BATCH204 //CARS DD DSN=M204.FILE.CARS,DISP=SHR //CARS2 DD DSN=M204.FILE.CARS2,DISP=SHR //AUTOS DD DSN=M204.FILE.CARS,DISP=SHR //AUTOS2 DD DSN=M204.FILE.CARS2,DISP=SHR //DUMPCARS DD DISP=(NEW,PASS),UNIT=TAPE,VOL=SER=ABCDEF //CCAIN DD * user zero parameters OPEN CARS DUMP TO DUMPCARS CLOSE CARS CREATE FILE AUTOS FROM AUTOS,AUTOS2 END OPEN AUTOS RESTORE 192 FROM DUMPCARS CLOSE ALL EOJ /*

Only the first ddname must be changed when a file is renamed. The above example could be changed to CREATE AUTOS FROM AUTOS,CARS2 and the AUTOS2 DD statement could be omitted.

z/VSE example

// JOB RENAME FILE CARS . . . // DLBL CARS,'M204.FILE.CARS',,DA // EXTENT ,volser // DLBL CARS2,'M204.FILE.CARS2',,DA // EXTENT ,volser // DLBL AUTOS,'M204.FILE.CARS',,DA // EXTENT ,volser // DLBL AUTOS2,'M204.FILE.CARS2',,DA // EXTENT ,volser // TLBL SYS010,'M204.DUMP.CARS' // ASSGN SYS010,X'300' // DLBL CCASTAT,'M204.CCASTAT' // EXTENT ,volser // UPSI 10010000 // EXEC BATCH204,SIZE=AUTO user zero parameters LOGIN userid password DEFINE DATASET DUMPCARS WITH SCOPE=SYSTEM FILENAME=SYS010 OPEN CARS DUMP TO DUMPCARS CLOASE CARS CREATE FILE AUTOS FROM AUTOS,AUTOS2 END OPEN AUTOS RESTORE 192 FROM DUMPCARS CLOSE ALL EOJ /*

z/VM example

In z/VM, run the RENAME EXEC by entering the following command:

ONLINE BYPASS RENAME

The RENAME EXEC follows:

&CONTROL OFF FILEDEF CLEAR * FILEDEF CCASNAP PRINTER FILEDEF CCATEMP DISK CCATEMP WORK ( XTENT 20 LRECL 6184 FILEDEF CCASTAT M DSN WORK CCASTAT FILEDEF CCAPRINT DISK RENAME CCAPRINT A FILEDEF CCAAUDIT DISK RENAME CCAAUDIT A FILEDEF CARS M DSN M204 FILE CARS FILEDEF CARS2 M DSN M204 FILE CARS2 FILEDEF AUTOS M DSN M204 FILE CARS FILEDEF AUTOS2 M DSN M204 FILE CARS2 FILEDEF DUMPCARS TAP1 SL VOLID 123456 LABELDEF DUMPCARS VOLID 123456 FILEDEF CCAIN DISK RENAME CCAIN A &STACK SYSOPT 128 LIBUFF 600

where the CCAIN file, RENAME CCAIN, is:

PAGESZ=6184 OPEN CARS DUMP TO DUMPCARS CLOSE CARS CREATE FILE AUTOS FROM AUTO,AUTOS2 END OPEN AUTOS RESTORE 192 FROM DUMPCARS EOJ

Backing up and restoring multitape files under z/VM

Under z/VM, you can use the M204APND and M204LDEF commands, along with FILEDEF and LABELDEF statements, to back up and restore multitape Model 204 files.

This section provides prototypes for backing up and restoring Model 204 files that require more than one tape. These prototypes represent components of z/VM EXECs. Modify the prototypes to meet your site's requirements.

Prototypes for backing up and restoring files

The following prototypes contain only the FILEDEFs, LABELDEFs, M204APNDs, and M204LDEFs required. The following assumptions are made for the prototypes:

  • One of the files might span a tape volume, but it is not known which one.
  • No file spans more than one tape volume.

If a given file spans two tape volumes, you must repeat the M204APND and M204LDEF pair for each additional tape.

The prototypes show two files being backed up or restored, but the prototypes can be extended to back up or restore as many files as necessary.

Backup prototype

FILEDEF file1 TAP1 SL 1 Output data set LABELDEF file1 FSEQ 1 M204APND file1 TAP1 SL If a file spans two tape volumes, repeat the M204LDEF file1 FSEQ 1 M204APND and M204LDEF commands FILEDEF file2 TAP1 SL 2 (LEAVE LABELDEF file2 FSEQ 2 M204APND file2 TAP1 SL M204LDEF file2 FSEQ 2

Restore prototype

FILEDEF file1 TAP1 SL 1 Input data set LABELDEF file1 FSEQ 1 VOLID volidx M204APND file1 TAP1 SL If a file spans two tape volumes, M204LDEF file1 FSEQ 1 VOLID volidx repeat the M204APND and M204LDEF commands FILEDEF file2 TAP1 SL 2 LABELDEF file2 FSEQ 2 VOLID volidx M204APND file2 TAP1 SL M204LDEF file2 FSEQ 2 VOLID volidx