Chapter 15: Utility Programs

MSS has a number of utility programs. Many of these emulate the functions of commonly-used mainframe batch utilities. You can invoke these utilities in a JCL jobstream or REXX exec.

There are two types of utility program:

This chapter also describes how, if required, you can write your own utility program; see the section Writing Your Own Utility Programs for details.

Emulations of Mainframe Utilities

This section describes the mainframe emulation utilities. You can invoke these utilities in a JCL jobstream or REXX exec by using the same program names, data sets and commands as on the mainframe. The mainframe utilities emulated by MSS are:

These names are defined as aliases for the equivalent MSS utility.

This section describes the special considerations that apply when you use these utilities in a MSS environment. It does not include information on behavior that is the same in mainframe and MSS environments. For full information on the mainframe utilities referred to in this section, see the relevant IBM documentation.

Note: If you wish to debug programs invoked by IKJEFT01, you must specify its equivalent MSS utility, IDAEFT01, as the program to debug.

Sort/Merge Operations (MFJSORT)

MFJSORT emulates the DFSORT and SORT mainframe utilities. It provides the following sort/merge operations for sequential data sets:

JCL Statements

This section describes the JCL statements used with the MFJSORT utility.

EXEC Statement

In the EXEC statement you need to specify the program named MFJSORT or its alias DFSORT or SORT. For example:

//STEPEXEC PGM=DFSORT,......
DD Statements

The following DD statements are required for all uses of MFJSORT:

The following DD statements are optional:

Creating a Statistics Report

You can create a statistical report in the form of ASCII spool output by adding the following command to your JCL statement://MFJSTATS DD SYSOUT=*

If your sort is not running under mainframe emulation, you can create a statistical report by using the MFJSTATS environment variable. For more information, see Environment Variables Summary.

Program Control Statements

The program control statements supported by MFJSORT are listed below, together with any restrictions. The rules for coding the statements are identical to the mainframe utility.

Program Control Statements Description
ALTSEQ Specifies an alternate collating sequence for AQ control fields.
END Indicates the end of the program control statements. If omitted, MFJSORT reads to end of file.
INCLUDE Includes records from the input data set based on comparison testing of one or more fields in the input record. Supports substring comparison and bit logic (bit operator and bit comparison) tests. You can specify up to 16 conditional expressions.
INREC Rearranges input records before sorting or merging. Note that INREC may change the location of the control fields used by SORT, MERGE, OUTFIL, OUTREC and SUM statements.
MERGE Defines a merge operation. You can include a COPY request in the MERGE statement. You can select portions of the input data sets for merging. You can define up to 32 control fields, but the total length of the control fields must not exceed 1,024 bytes. You can request ascending or descending sequences for the following control field types:
AQ Alternate collating sequence
BI Binary
CH Character
CLO or OL Signed numeric with leading overpunched sign
CTO or OT Signed numeric with trailing overpunched sign
CSF or FS Signed numeric with optional leading floating sign
CSL or LS Signed numeric with leading separate sign
CST or TS Signed numeric with trailing separate sign
FI Fixed integer
FL Floating point. Only 4-byte and 8-byte forms are supported. (COMP-1 and COMP-2)
PD Packed decimal
PD0 Packed decimal, with sign and first digit ignored
Y2B Two-digit, one-byte binary year data
Y2C or Y2Z Two-digit, two-byte character or zoned decimal year data
Y2D Two-digit, one-byte decimal year data
Y2P Two-digit, two-byte packed decimal year data
Y2S Two-digit, two-byte character or zoned decimal year data, with special indicators
ZD Zoned decimal
MODS Specifies the names of the E15 and E35 exit programs. Other exits are not supported.
OMIT Excludes records from the input data set based on comparison testing of one or more fields in the input record. Supports substring comparison and bit logic (bit operator and bit comparison) tests. You can specify up to 16 conditional expressions.
OUTFIL Writes multiple output files. OUTFIL allows for extensions.
  • Use the INCLUDE, OMIT and SAVE operands to select the records to be included in each output data set. The INCLUDE and OMIT operands provide all of the capabilities of the INCLUDE and OMIT statements, while SAVE can be used to select the records that are not selected for any other subset.
  • The OUTREC operand provides editing and control of the way numeric fields are presented with respect to length, leading or suppressed zeros, symbols, and so on. Twenty six pre-defined editing masks (M0 to M25) are available, and user-defined masks can be created using, for example, the EDIT, SIGNS and LENGTH options. Use the CHANGE option to select a character or hexadecimal string for output from a lookup table, based on a character, hexadecimal or bit string as input.
  • Use the STARTREC and ENDREC operands to select a range of records to be included in each output data set.
  • Use the SPLIT operand to distribute the records evenly among the output data sets.
  • Use the operands LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS and NODETAIL, together with OUTREC, to create complex reports including, for example, totals, maximums, minimums and averages for numeric input fields.
OUTREC Rearranges output records after sorting or merging. It can also insert literal variables into the output record. Supports reformatting of records as well as the creation of formatted reports.
RECORD Specifies record length information. Only the first value of this statement, which specifies the maximum record length, is used; all other values are ignored. The logical record length of the input data set overrides any value specified by the RECORD statement.
SORT Defines a sort operation. You can include a COPY request in the SORT statement. You can define up to 32 control fields, but the total length of the control fields must not exceed 1,024 bytes. You can request ascending or descending sequences for the same control field types as described for the MERGE statement.
SUM Produces only one output record for records with duplicate sort fields. Optionally, numeric fields in the duplicate records can be summed in the output record. The sum operation can be done for the following control field types:
BI Binary
FI Fixed integer
FL Floating point
PD Packed decimal
ZD Zoned decimal
Exits

MFJSORT, like its mainframe counterpart, invokes user exit programs for the E15 read exit and the E35 write exit. The exit programs should be written in COBOL and compiled by the Micro Focus syntax checker. They can be executed normally or debugged like any other COBOL program. Please refer to the mainframe documentation for instructions on writing and testing exit programs.

Linkage Areas

MFJSORT provides a standard linkage area to the E15 and E35 exit program. It is compatible with the mainframe utility and should be defined as follows:

COBOL Statements Value
RECORD-FLAGS PIC 9(8) COMP. 0 indicates the first record passed. 4 indicates subsequent records passed. 8 indicates the last record passed.
ENTRY-BUFFER PIC X(n). Contents of the input record. Do not change this area.
EXIT-BUFFER PIC X(n). Contents of the new or altered record provided by the exit.
UNUSED-ENTRY PIC 9(8) COMP. Not used
UNUSED-ENTRY PIC 9(8) COMP. Not used
ENTRY-RECORD-LENGTH PIC 9(8) COMP. Length of the input record.
EXIT-RECORD-LENGTH PIC 9(8) COMP. Length of the new or altered record provided by the exit.
UNUSED-ENTRY PIC 9(8) COMP. Not used
EXIT-AREA-LENGTH PIC 9(4) COMP. Length of the exit area scratchpad. Do not change this field.
EXIT-AREA PIC X(n). Exit area scratchpad used by the exit to maintain variables between calls to the exit program.
Return Codes

MFJSORT recognizes the same return codes from exit programs as the mainframe utility, as listed in the following table:

Return Code Meaning
0 No action required.
4 Delete the current record. For E15, the record is not sorted. For E35, the record is not written to the output data set.
8 Do not call this exit again; exit processing is no longer required.
12 Insert the current record. For E15, the record is inserted for sorting. For E35, the record is written to the output data set.
16 Terminate MFJSORT. The job step is terminated with the condition code set to 16.
20 Alter the current record. For E15, the altered record is passed to the sort. For E35, the altered record is written to the output data set.
SYNCSORT Emulation

MSS also provides limited emulation of SYNCSORT behavior. The behavior for SYNCSORT emulation is essentially the same as for DFSORT emulation, with the following exceptions:

To specify that you want to use SYNCSORT, set the environment variable MFJSENGINE=SYNCSORT in Configuration Information on the Server > Properties > General page for the enterprise server you are using

VSAM Access Method Services (MFJAMS)

MFJAMS emulates the main functions of the IDCAMS mainframe utility. It provides the following management services for VSAM key-sequenced data sets (KSDS), entry-sequenced data sets (ESDS) and relative-record data sets (RRDS).

You can use some of these services for sequential data sets, partitioned data sets and generation data groups. All abbreviations of these commands and their parameters that are valid on the mainframe are supported by MFJAMS.

You can execute MFJAMS via a JCL jobstream or REXX exec.

For more information on VSAM access method services, see the IBM manual DFSMS/MVS Access Method Services for VSAM, SC26-4905.

File Structure

Unlike the mainframe, a VSAM KSDS or ESDS data set is usually represented under Windows by two files - a data file, which contains the actual data records for the VSAM data set, and an index file, which contains the primary and alternate key data. These files usually have filename extensions of .dat and .idx respectively. The exception is where IDXFORMAT8 files are in use; these have just a .dat file.

Although the two-file structure affects the way that IDCAMS commands are processed, it does not change the final outcome of the commands. The results of executing commands in a non-mainframe environment is the same as on the mainframe. MFJAMS ignores those parts of a command that have no relevance in a non-mainframe environment. For example, because the VSAM file structure under Windows does not provide CI or CA sizes to manipulate, these command parameters are ignored.

JCL Statements

This section describes the JCL statements used with the MFJAMS utility.

EXEC Statement

In the EXEC statement you need to specify the program name MFJAMS or its alias IDCAMS. For example:

//STEPEXEC PGM=IDCAMS,.......
DD Statements

The following DD statements are required for all uses of MFJAMS:

The following DD statements are used by some commands:

Commands

This section describes the MFJAMS commands.

ALTER

The ALTER command changes the attributes of an MVS data set.

MFJAMS uses the parameters described in the following table. All other parameters are ignored.

Parameters:
data-set-name Name of the data set to be renamed. This parameter is required.
NEWNAME(data-set-name) The new name for the data set. This parameter is required.
Comments:

You cannot use * as a qualifier to rename a number of data sets with one command. For example, ABC.*.FILE is not permitted.

DEFINE ALTERNATEINDEX

The DEFINE ALTERNATEINDEX command creates an alternate index for an existing VSAM data set. It also automatically reindexes the data set to maintain consistency between the data and index files on the PC. The alternate index is contained within the same file as the primary index.

MFJAMS uses the parameters described in the following table. All other parameters are ignored.

Parameters:
NAME(data-set-name) Name of the data set. This parameter is required.
KEYS(length offset) Length and offset, relative to 0, of the alternate key field. The offset must be within the first 4,096 bytes of the record. Length plus offset must not exceed the maximum length of the record. The default is KEYS(64 0)
UNIQUEKEY Each alternate key value in the records is unique
NONUNIQUEKEY The alternate key values may contain duplicates
RELATE(data-set-name) Name of a cataloged VSAM data set to which the alternate index is to be related
Comments:
DEFINE CLUSTER

The DEFINE CLUSTER command creates a new VSAM data set. It creates the data and index files on the local machine and catalogs the data set name.

MFJAMS uses the parameters described in the following table. All other parameters are ignored.

Parameters:
NAME(data-set-name) Name of the VSAM data set. This parameter is required
INDEXED That a KSDS data set is being defined
NONINDEXED That an ESDS data set is being defined
NUMBERED That an RRDS data set is being defined
KEYS(length offset) Length and offset, relative to 0, of the primary key field for a KSDS data set. The offset must be within the first 4096 bytes of the record. length plus offset must not exceed the maximum length of the record. The default is KEYS(64 0)
RECORDSIZE(average maximum) Average and maximum lengths of the records, expressed in decimal format. If the lengths are the same, a fixed-length format is assumed. If the lengths are different, a variable-length format is assumed. The default is RECORDSIZE(4089 4089)
MODEL(data-set-name) Name of a cataloged VSAM data set that has the same KEYS and RECORDSIZE parameters as this new data set. It is an alternative to specifying the parameters explicitly
Comments:
Example:

Here is a typical job to define a cluster:

//DEFCLUS  JOB  CLASS=A
//IDCSTEP  EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
DEFINE CLUSTER(NAME(TEST.KSDS.DUMMY) KEYS(5,0) -
       RECORDSIZE(80,80))

Note the use of the continuation character (-) in the DEFINE CLUSTER statement.

DEFINE PATH

The DEFINE PATH command causes MFJAMS to create a dummy path data set so that any DD statement that refers to the data set will not fail. The data set is not needed for any other purpose because MFJAMS implements this function in a different way to the mainframe.

MFJAMS uses the parameters described in the following table. All other parameters are ignored.

Parameters:
NAME(data-set-name) Name of the path data set. This parameter is required.
DELETE

The DELETE command deletes up to 99 data sets. It can be used for both VSAM and non-VSAM data sets. It deletes the local files associated with the data set and removes the entry from the catalog.

MFJAMS uses the parameters described in the following table. All other parameters are ignored.

Parameters:
data-set-names Names of the data sets to be deleted. This parameter is required. You can specify a list of names separated by blanks and enclosed in parentheses. You can also specify generic names by using '*' as a qualifier. For example, a generic data set name of ABC.*.FILE means all data sets with ABC as the first qualifier, any value as the second qualifier, and FILE as the third and last qualifier
FORCE All GDG data sets will be deleted in addition to the GDG catalog entry
NOFORCE The GDG catalog entry will not be deleted if any GDG data sets exist
Comments:

FORCE and NOFORCE are mutually exclusive. NOFORCE is the default.

LISTCAT

The LISTCAT command lists the data set names contained in the catalog.

MFJAMS uses the parameters described in the following table. All other parameters are ignored.

Parameters:
ENTRIES(data-set-names) Names of the data sets to be listed. You can specify a list of names separated by blanks. You can also specify generic names by using '*' as a qualifier. For example, a generic data set name of ABC.*.FILE means all data sets with ABC as the first qualifier, any value as the second qualifier and FILE as the third and last qualifier
LEVEL(level) Prefix qualifier of the data sets to be listed. For example, a level of ABC means all data sets with ABC as the first, high-level, qualifier
Comments:

ENTRIES and LEVEL are mutually exclusive; you can specify only one of them. LEVEL(*) is the default if neither is specified.

PRINT

The PRINT command prints the contents of both VSAM and non-VSAM data sets. It prints a complete data set or part of a data set in character format, hexadecimal format or both formats.

MFJAMS uses the parameters described in the following table. All other parameters are ignored.

Parameters:
INFILE(ddname) Name of the DD statement, contained in the JCL for this job step, that provides the name of the data set that is to be printed.
INDATASET(data-set-name) Name of the data set that is to be printed.
OUTFILE(ddname) Name of the DD statement for the printed output. The data set must have an LRECL value of at least 121. If you omit OUTFILE, the SYSPRINT DD statement is assumed.
FROMKEY(key) For a VSAM KSDS data set only, the key of the first record to print. Printing starts at the record with the same primary key, or the record with the nearest higher key if an exact match does not occur. Alternate indices are not used.
TOKEY(key) For a VSAM KSDS data set only, the key of the last record to print. Printing ends at the record with the same primary key, the record with the nearest higher key if an exact match does not occur, or end of file. Alternate indices are not used.
SKIP(number) The number of records to skip before printing starts
COUNT(number) The number of records to print
CHARACTER Records are to be printed in character format. MFJAMS converts EBCDIC data sets to ANSI. Unprintable characters are printed as periods.
HEX Records are to be printed in hexadecimal format. MFJAMS prints each byte in the record as a two-byte hexadecimal value
DUMP Records are to be printed as a storage dump, in both hexadecimal and character format. MFJAMS converts EBCDIC data sets to ANSI. Unprintable characters are printed as periods.
Comments:
REPRO

The REPRO command copies the contents of one data set to another. The data sets can have either VSAM or sequential organization. Thus the REPRO command can:

MFJAMS uses the parameters described in the following table. All other parameters are ignored.

Parameters:
INFILE(ddname) Name of the DD statement, contained in the JCL for this job step, that provides the name of the data set that is to be used for input.
INDATASET(data-set-name) Name of the data set that is to be used for input
OUTFILE(ddname) Name of the DD statement, contained in the JCL for this job step, that provides the name of the data set that is to be used for output.
OUTDATASET(data-set-name) Name of the data set that is to be used for output
FROMKEY(key) For a VSAM KSDS only, the key of the first record to copy. Copying starts at the record with the same primary key, or the record with the nearest higher key if an exact match does not occur. Alternate indices are not used.
TOKEY(key) For a VSAM KSDS only, the key of the last record to copy. Copying ends at the record with the same primary key, the record with the nearest higher key if an exact match does not occur, or end of file. Alternate indices are not used.
SKIP(number) The number of records to skip before copying starts
COUNT(number) The number of records to copy
REPLACE For VSAM files only, the record in the input data set replaces any record in the output data set that has the same primary key
NOREPLACE For VSAM files only, the record in the input data set does not replace any record in the output data set that has the same primary key
Comments:
SET

The SET command alters a condition code set by previous MFJAMS commands in this job step. MFJAMS uses only the MAXCC and LASTCC parameters, as described below. All other parameters are ignored.

Parameters:
MAXCC=number Value that is to be set for the maximum condition code that was produced by all previous MFJAMS commands.
LASTCC=number Value that is to be set for the last condition code that was produced by a MFJAMS command.
Comments:

In both cases, the highest valid value is 16. If you specify a higher value, MFJAMS sets the condition code to 16.

VERIFY

The VERIFY command attempts to open a VSAM data set in order to verify that it can be read and that the index is usable. The data set is assumed to be readable if it can be opened without error or if it is locked to another process.

If the index is found to be unusable, the VERIFY command rebuilds the index by creating a new index file for the primary key and all alternate keys. The data portion of the data set is not changed.

MFJAMS uses the parameters described in the following table. All other parameters are ignored.

Parameters:
FILE(ddname) Name of the DD statement, contained in the JCL for this job step, that provides the name of the data set that is to be verified.
DATASET(data-set-name) Name of the data set
Comments:

FILE and DATASET are mutually exclusive. You must specify one of them.

Comparing Data Sets (MFJMATCH - IEBCOMPR)

To compare two sequential or partitioned data sets you can use the MFJMATCH utility. MFJMATCH works in two modes, depending on the EXEC statement you use to invoke it:

EXEC StatementDescription
PGM=IEBCOMPR   MFJMATCH emulates the IEBCOMPR mainframe utility.
PGM=MFJMATCHMFJMATCH performs a data set comparison but does not emulate the IEBCOMPR mainframe utility.

This section describes how to use MFJMATCH to emulate the IEBCOMPR mainframe utility. For information on using the non-IEBCOMPR version of MFJMATCH, see the section Comparing Data Sets (MFJMATCH).

JCL Statements

This section describes the JCL statements used with the MFJMATCH utility.

EXEC Statement

In the EXEC statement you need to specify MFJMATCH's alias, IEBCOMPR. For example:

//STEPEXEC PGM=IEBCOMPR, ...

Note: Specifying MFJMATCH instead of IEBCOMPR in the EXEC statement causes MFJMATCH to behave as described in the section Comparing Data Sets (MFJMATCH).

DD Statements

The following DD statements are required for all uses of MFJMATCH:

The following DD statement is optional:

Control Statements

The following control statements are parsed but not processed:

Copying and Merging Partitioned Data Sets (MFJCOPY)

MFJCOPY emulates the operation of the IEBCOPY mainframe utility for copying and merging partitioned data sets.

JCL Statements

This section describes the JCL statements used with the MFJCOPY utility.

EXEC Statement

In the EXEC statement you need to specify the program name MFJCOPY or its alias IEBCOPY. For example:

//STEPEXEC PGM=IEBCOPY, ...
DD Statements

The following DD statements are required for all uses of MFJCOPY:

The following DD statement is optional:

The following DD statements, which are used by the mainframe utility, are ignored by MFJCOPY:

Control Statements

The following control statements are parsed but not processed:

Additional differences between behavior on the mainframe and in MSS are as follows:

Copying Sequential Data Sets (MFJGENER)

MFJGENER emulates the basic copy operations of the IEBGENER mainframe utility for sequential data sets (that is, PS or PSU data sets, or members of PO or POU data sets.) It ignores commands specified in the SYSIN data set.

JCL Statements

This section describes the JCL statements used with the MFJGENER utility.

EXEC Statement

In the EXEC statement you need to specify the program name MFJGENER or its alias IEBGENER. For example:

//STEPEXEC PGM=IEBGENER,......
DD Statements

The following DD statements are required:

The following DD statement, which is used by the mainframe utility, is ignored by MFJGENER:

Control Statements

The following list describes how MFJGENER processes control statements differently than IEBGENER:

Creating or Modifying Data Sets (MFJUPDTE)

MFJUPDTE emulates the IEBUPDTE mainframe utility for creating or modifying sequential or partitioned data sets.

JCL Statements

This section describes the JCL statements used with the MFJUPDTE utility.

EXEC Statement

In the EXEC statement, you need to specify the program name MFJUPDTE or its alias IEBUPDTE. For example:

//STEPEXEC PGM=IEBUPDTE, ...
DD Statements

The following DD statements are required:

Control Statements

The following control statements are parsed but not processed:

The following sub-operands for the function statement (ADD, CHANGE, REPL or REPRO) are parsed but not processed:

Dummy Program (MFJBR14)

MFJBR14 emulates the IEFBR14 mainframe utility. It provides a dummy program facility by simply returning to the caller. It can be used, for example, in a job step to delete data sets at the appropriate time. You can also use it to replace a program that does not have a version on the local machine, so that you can still test data set allocation and disposition for the job step.

JCL Statements

This section describes the JCL statements used with the MFJBR14 utility.

EXEC Statement

In the EXEC statement you need to specify the program name MFJBR14 or its alias IEFBR14. For example:

//STEPEXEC PGM=IEFBR14,......

Executing TSO Commands in Batch Mode (IDAEFT01)

IDAEFT01 emulates the IKJEFT01 mainframe utility program. It starts a TSO session in batch, and the TSO session executes the TSO commands contained in the data set defined by the SYSTSIN DD statement.

Although the SYSTSIN data set can contain any of the TSO and DB2 commands supported by MSS, IDAEFT01 is typically used to run DB2/TSO applications in batch mode. Input for such applications is, at a minimum:

DSN SYSTEM(system)
RUN PROGRAM(name) PARM(parm-string)
 ....
END
Parameter Description
SYSTEM(system) Specifies the name of the DB2 system.
PROGRAM(name) Specifies the name of the program to be executed. IDAEFT01 can execute any application program that is compiled within your COBOL development system, provided you have set the necessary directives.
PARM(parm-string) Specifies the parameter string that is to be passed to the program through the standard linkage area.

If you are running a DB2 application, you need to define an XA Resource for the database manager. You can do this in either ES Admin or ESMAC:

How to...

JCL Statements

This section describes the JCL statements used with the IDAEFT01 utility.

EXEC Statement

In the EXEC statement you need to specify the program name IDAEFT01 or its alias IKJEFT01. For example:

//STEPEXEC PGM=IKJEFT01,PARM='initial-command',.......
DD Statements

The following DD statement is required:

You must also include any DD statements for sequential and VSAM data sets that are accessed by the application program.

Running REXX Execs in MVS Batch Mode (MFIRXJCL)

MFIRXJCL emulates the IRXJCL mainframe utility program. It starts an MVS session in batch mode and runs the REXX exec specified in the PARM parameter. For more information about the REXX support in MSS see the chapter REXX Support.

JCL Statements

This section describes the JCL statements used with the MFIRXJCL utility.

EXEC Statement

In the EXEC statement you need to specify the program name MFIRXJCL, or its alias IRXJCL, and the name of the REXX exec as the first word in the PARM parameter. For example:

//STEPEXEC PGM=IRXJCL,PARM='REXXEXEC'
DD Statements

The following DD statements may be required:

You must also include any DD statements for data sets that are accessed by the exec.

Generating Test Data (MFJDG)

MFJDG emulates the IEBDG mainframe utility for creating test data.

JCL Statements

This section describes the JCL statements used with the MFJDG utility.

EXEC Statement

In the EXEC statement, you need to specify the program-name MFJDG or IEBDG. For example:

//STEPEXEC PGM=IEBDG, ...

Any PARM on the exec statement is ignored.

DD Statements

The following DD statements are required:

Control Statements

The following sub-operands are parsed but not processed:

Micro Focus Utilities

This section describes the Micro Focus utility, MFJMATCH.

Comparing Data Sets (MFJMATCH)

The MFJMATCH utility compares two MVS data sets. It accepts any record format, record length or data set organization supported by your COBOL development system. If the data sets match, it ends with a return code of 0. If the two data sets do not match, when the MFJMATCH utility finds the first mismatch it writes the two records that differ to a third data set (with asterisks under the columns that differ), then ends with a return code of 12. Records following the first mismatch are not compared.

Note:

You can also use the MFJMATCH utility to emulate the IEBCOMPR mainframe utility. For information on doing this, see the section Comparing Data Sets (MFJMATCH - IEBCOMPR).

If the data sets being compared are EBCDIC, the MFJMATCH utility also writes the hexadecimal representation.

JCL Statements

This section describes the JCL statements used with the MFJMATCH utility.

EXEC Statement

In the EXEC statement you need to specify the program name MFJMATCH. For example:

//STEPEXEC PGM=MFJMATCH
DD Statements

The following DD statements are required:

Program Control Statements

The program control statements supported by MFJMATCH are listed below. The program control statements define search criteria that limit matching to a particular range of records and to portions of the record.

Program Control Statements Description
KEY=(start,length) Defines a key field for use by FROMKEY and TOKEY program control statements. This statement can only occur once. The parameters are:
start The position in the record at which the key starts.
length The length of the key.

For VSAM keyed files, the KEY defaults to the actual key, although, as the files are processed sequentially, any field can be defined as the key for the purpose of specifying a range for record matching.

INCLUDE Compare records only in the ranges defined by FROMKEY TOKEY or FROMREC COUNT

SKIP and INCLUDE are mutually exclusive.

SKIP Ignore records in the ranges defined by FROMKEY TOKEY or FROMREC COUNT.

SKIP and INCLUDE are mutually exclusive.

FROMKEY='value1' TOKEY='value2' Defines a range of records. value1 specifies the first record in the range, while value2 specifies the last record in the range. Hexadecimal values can be specified as x'hhhhhh', where hhhhhh is a hexadecimal number.
FROMREC=x COUNT=y Defines a range of record numbers, from record number x for the next y records
FD=(start,length) Defines a field to be ignored when comparing records -used with INCLUDE only
Example

In the following example:

//SYSIN DD *
 KEY=(1,10)
 INCLUDE FROMKEY='AAAAAAAAAA' TOKEY='BBBBBBBBBB'
 INCLUDE FROMKEY='WWWWWWWWWW' TOKEY='YYYYYYYYYY'
 FD=(11,5)
 FD=(21,5)

Writing Your Own Utility Programs

You might need to write your own utility programs or obtain them from other software vendors. MSS passes a standard MVS parameter area to these programs when they are invoked by TSO commands or JCL statements.

For a COBOL program, the parameter area has the following definition:

01 PARM.
      03 PARM-LENGTH         PIC 9(4)COMP.
      03 PARM-DATA.
         05 PARM-DATA-ARRAY  PIC X OCCURS 100.

PARM-DATA contains the data specified in the parameter field of the TSO command or JCL statement. MSS converts it to the default data representation defined for your system - ANSI or EBCDIC. The utility program should inspect the parameter data, determine its data representation and convert it, if necessary, to the representation used by the program.

Note: The utility program must be compiled within your COBOL development system to ensure that all interactions with the system are handled correctly.


Copyright © 2008 Micro Focus (IP) Ltd. All rights reserved.