Previous Topic: Archive Files and File Groups

Next Topic: Automatic Archive of File Groups

ARCHIVE Statement

To archive members of a file group, specify an ARCHIVE statement and provide the following information:

Note: A file can be archived only if it was defined with the REUSE option of the DEFINE CLUSTER control statement of the IDCAMS utility.

For example, to archive all files in the ENDJRN group (including the currently active file) and store their contents in the ARCHDS file, specify the following ARCHIVE statement:

//         EXEC  PGM=LDMAMS
//SSN$xxxx DD    DUMMY
//SYSPRINT DD    SYSOUT=A
//SYSIN    DD    *
ARCHIVE    GROUP(ENDJRN)   OUTFILE(ARCHDS)   SWITCH
//ARCHDS   DD    DSN=LSERV.ARCH

Or, to archive file JRNL1 and store its contents in the ARCHDS file, specify the following ARCHIVE statement:

//         EXEC  PGM=LDMAMS
//SSN$xxxx DD    DUMMY
//SYSPRINT DD    SYSOUT=A
//SYSIN    DD   *
ARCHIVE    INFILE(JRNL1)   OUTFILE(ARCHDS)
//ARCHDS   DD   DSN=LSERV.ARCH