You can run the process using a JCL job or using a utility from an
command prompt.
Using the JCL job
The JCL job
MERGESPL.JCL is located in the
/opt/microfocus/EnterpriseDeveloper/cpylib directory by default. Configure the following parameters within the source code to suit your requirements, and then submit
the job in the usual way:
- ARCHIVE LOC
- The location of a folder containing archived spool files. Use this option or the SCAN option to select the spool files to
archive.
ARCHIVE LOC full-path-to-archive
- SCAN LOC
- A top-level directory, where each containing sub-directory is scanned for archived spool files. Use this option or the ARCHIVE
option to select the spool files to archive.
SCAN LOC full-path-to-archive
- MERGE LOC and MERGE SUBLOC
- Both of these identify locations where archived spool files identified by one of the two previous parameters are copied. Merged
versions of the JES spool control files and
catalog.dat are created (all prefixed with
M_), and it is the
M_SPLJOB.DAT data file that you open in the
Data File Editor to view the merged spool files.
Note: If a merge location already contains merged archive spool files, the existing control files (files prefixed M_) are amended
to accommodate the new spool files.
MERGE LOC and MERGE SUBLOC differ as follows:
- MERGE LOC
- A parent folder that identifies one location into which all archived spool files are copied.
MERGE LOC full-path
- MERGE SUBLOC
- Identifies a sub-folder or folders of MERGE LOC where spool files are copied.
MERGE SUBLOC {INDEX|WEEK|MONTH|USERNAME user-name|MIRROR}
Important: Each JCL job takes only one parameter for MERGE SUBLOC. If you specify more than one MERGE SUBLOC parameter on a single line
or you add multiple MERGE SUBLOC entries into your
MERGESPL.JCL file, the job uses only the last parameter it finds.
- INDEX
- Spool files for the first merge archive job are stored in a sub-folder of MERGE LOC named using an index of
000000001. Subsequent runs increment that index and store spool files in a sub-folder named for the incremented index.
- WEEK
- Spool files are stored in a sub-folder identified by the week of the current year as follows:
merge-loc/current-year_week-num
Where
week-num is a two-digit representation of the week of the year. For example:
2023_32
Represents the 32nd week of the year 2023.
- MONTH
- Spool files are stored in a sub-folder identified by the month of the current year as follows:
merge-loc/current-year_month-num
Where
month-num is a two-digit representation of the month of the year. For example:
2023_07
Represents the 7th month of the year 2023.
- USERNAME
user-name
- Spool files are stored in a sub-folder of the same name as the string entered as
user-name.
- MIRROR
- Stores spool files in a sub-folder bearing the same name as the original archive folder from the spool-housekeeping archive
location.For example, if the spool housekeeping archive is
/home/user/Archive/20230310, the spool files are stored in a sub-folder of MERGE LOC named
20230310.
Example:
The following JCL, scans the
C:\spl-arc\ directory for sub-directories containing archived spool files. The files it finds are merged into the
C:\spl-merge\Nov-18\ directory.
//MERGESPL JOB 'MERGE SPOOL ARCHIVES',CLASS=A,MSGCLASS=A
//**********************************************************************
//*<CR_TAG_JCL\>//*//* Copyright (C) Micro Focus 1984 - 2022 or one of its affiliates.
//* This sample code is supplied for demonstration purposes only
//* on an "as is" basis and "is for use at your own risk".
//*
//*<CR_TAG_JCL_END\>
//**********************************************************************
//* Merge a spool archive into a merged archive
//**********************************************************************
//ARCHIVE EXEC PGM=MERGESPL//SYSPRINT DD SYSOUT=*//SYSOUT DD SYSOUT=*
//SYSERR DD SYSOUT=*//* SYSIN or CONFIGI dataset contains the program parameters
//SYSIN DD *
* --------------------------------------------------------
* MERGED SPOOL HOUSEKEEPING CONFIGURATION FILE
* --------------------------------------------------------
* ARCHIVE LOCATION - the archive to read
* --------------------------------------------------------
* ARCHIVE LOC C:\ES_ERRORS\MERGED_ARCHIVES\SET_A\2018052611114975
* --------------------------------------------------------
* TOP LEVEL DIRECTORY TO SCAN
SCAN LOC C:\ES_ERRORS\MERGED_ARCHIVES
* --------------------------------------------------------
* MERGED ARCHIVE LOCATION - The location of the merged archive
* --------------------------------------------------------
MERGE LOC C:\ES_ERRORS\MERGED_ARCHIVES\MERGED_ARCHIVE
* --------------------------------------------------------
* MERGED ARCHIVE SUB-FOLDER SPEC - INDICATES TYPE OF SUB-FOLDER(S)
* --------------------------------------------------------
MERGE SUBLOC MONTH
/*
//
Tip: The ARCHIVE step in the above JCL could well be added as a new step at the end of your existing spool housekeeping job. Also,
note how you can specify the merge parameters using a configuration file by using the CONFIGI parameter shown above.
Using the command line utility
Use the following syntax from an
command prompt:
MergeArchives SCAN|ARCH arch-spool-file-directory/directories directory-for-merged-spool-files
Where:
- SCAN|ARCH
- Use SCAN to specify a parent directory in which its sub-directories are scanned for possible spool files to merge, or use
ARCH to specify a single directory in which only its contents are merged.
- arch-spool-file-directory/directories
- When using the SCAN parameter, specify a parent directory with sub-directories that each contain sets of archived spool files,
or when using the ARCH parameter, specify a directory that contains a set of archived spool files.
- directory-for-merged-spool-files
- Specify the directory in which the merged spool files will reside. Merged versions of the JES spool control files are created
in this location (all prefixed with
M_), and it is the
M_SPLJOB.DAT data file that you open in the
Data File Editor to view the merged spool files.
Note: If the merge location already contains merged archive spool files, the existing control files (files prefixed M_) are amended
to accommodate the new spool files.
Example:
The following command reads the
C:\spl-arc\2018111211042198 directory, and then creates a merged version of the archived spool files in a MERGE sub-directory of the current working
directory.
MergeArchives ARCH C:\spl-arc\2018111211042198 MERGE