PreviousSystem Intelligence Advanced Data Set InformationNext"

Chapter 3: Mainframe Utilities

Mainframe Express has a number of utility programs which emulate the functions of many commonly-used mainframe batch utilities. You can invoke these utilities in a JCL jobstream, TSO CLIST or REXX exec by using the same program names, data sets and commands as on the mainframe. The mainframe utilities that are emulated by Mainframe Express are:

These names are defined as aliases for the equivalent Mainframe Express utility. You can see the list of programs and aliases by selecting the Aliases page of the Project Settings dialog box from the Project menu. This chapter describes the special considerations that apply when you use these utilities in a Mainframe Express environment. For more information, please refer to the mainframe documentation for the utility.

3.1 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, TSO CLIST or REXX exec. You can also use it interactively via the Mainframe Express IDE Tools menu.

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

3.1.1 File Structure

Unlike the mainframe, a VSAM KSDS or ESDS data set is represented on the PC 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.

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 on the PC is the same as the mainframe. MFJAMS ignores those parts of a command that have no relevance on a PC. For example, because the VSAM file structure on a PC does not provide CI or CA sizes to manipulate, these command parameters are ignored.

3.1.2 JCL Statements

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

3.1.2.1 EXEC Statement

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

//STEPEXEC PGM=IDCAMS,.......

3.1.2.2 DD Statements

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

The following DD statements are used by some commands:

3.1.3 Commands

This section describes the MFJAMS commands.

3.1.3.1 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.

Parameter
Specifies
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

Notes:


3.1.3.2 DEFINE CLUSTER

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

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

Parameter
Specifies
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

Notes:

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.


3.1.3.3 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.

Parameter
Specifies
NAME(data set-name) Name of the path data set. This parameter is required.

3.1.3.4 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 PC 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.

Parameter
Specifies
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

Note:


3.1.3.5 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.

Parameter
Specifies
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

Note:


3.1.3.6 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.

Parameter
Specifies
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.

Notes:


3.1.3.7 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.

Parameter
Specifies
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

Notes:


3.1.3.8 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.

Parameter
Specifies
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.

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


3.1.3.9 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.

Parameter
Specifies
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

Note:


3.2 Sort/Merge Operations (MFJSORT)

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

3.2.1 JCL Statements

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

3.2.1.1 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,......

3.2.1.2 DD Statements

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

The following DD statements are optional:

3.2.2 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

3.2.3 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.

3.2.3.1 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.

3.2.3.2 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.

3.3 Copy 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.

3.3.1 JCL Statements

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

3.3.1.1 EXEC Statement

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

//STEPEXEC PGM=IEBGENER,......

3.3.1.2 DD Statements

The following DD statements are required:

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

3.4 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 PC, so that you can still test data set allocation and disposition for the job step.

3.4.1 JCL Statements

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

3.4.1.1 EXEC Statement

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

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

3.5 IMS Dispatcher (MFJIMS)

MFJIMS emulates some of the functions of the DFSRRC00 mainframe utility. It invokes the IMS Option batch run-time facility for a specific PSB name in order to dispatch a COBOL application that uses IMS.

MFJIMS does not allocate IMS databases; you should use the IMS Option of Mainframe Express to do this.

3.5.1 JCL Statements

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

3.5.1.1 EXEC Statement

In the EXEC statement you need to specify the program name MFJIMS or an alias. DFSRRC00 is defined as a generic alias. You could also define the commonly-used aliases DLIBATCH, DBBBATCH, IMSBATCH and IMSFP for different forms of IMS executions.

You also need to specify in the PARM field several parameters that are passed to IMS Option when it is invoked. For example:

//STEPEXEC PGM=DFSRRC00,PARM=(parameter-list),...

The PARM parameters required by IMS Option are listed below. Any other parameters which are used by the mainframe utility are ignored.

Parameters
Description
program-type This is the first parameter. It specifies the program type. Valid program types are DLI, DBB, BMP and IFP. The default is DLI.
program-name This is the second parameter. It specifies the processing (user) program name. It is required.
PSB-name This is the third parameter. It specifies the PSB for the processing program. If you do not specify it, IMS Option uses the program name.
checkpoint-ID This is the eighth parameter for DLI and DBB programs and the ninth parameter for BMP and IFP programs. It specifies a restart checkpoint ID to be used by IMS Option. It is optional.

Examples of valid parameter lists are:

//STEPEXEC PGM=DLIBATCH,PARM=(DLI,PROGNAME,PSBNAME,p4,p5,p6,p7,CHKPTID)
//STEPEXEC PGM=DBBBATCH,PARM=(DBB,PROGNAME,PSBNAME,p4,p5,p6,p7,CHKPTID)
//STEPEXEC PGM=IMSBATCH,PARM=(BMP,PROGNAME,PSBNAME,p4,p5,p6,p7,p8,CHKPTID)
//STEPEXEC PGM=IMSFP,PARM=(IFP,PROGNAME,PSBNAME,p4,p5,p6,p7,p8,CHKPTID)

3.5.1.2 DD Statements

DD statements for system data sets (DFSRESLB, DFSVSAMP, IMS, etc.) and IMS databases, which are normally required in a mainframe environment, are checked for validity. They are not required by IMS Option.

You must still include DD statements for non-IMS data sets and any GSAM databases that are accessed by the processing program.

3.5.2 SQL ATTACH

MFJIMS supports the execution of programs that contain SQL statements, using mechanisms similar to those used on the mainframe. To use this function, specify in the PARM parameters:

For example:

//IMSSQL EXEC PGM=DLIBATCH,PARM=(DLI,DSNMTV01,psb-name)

Then include a DD statement, with dd-name DDITV02, that defines a data set containing the parameter list for DSNMTV01. Specify the actual processing program name as the ninth parameter in this list. For example:

//DDITV02 DD *
p1,p2,p3,p4,p5,p6,p7,p8,program-name

3.6 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. These commands are listed in the chapter TSO Support.

Although the SYSTSIN data set can contain any of the TSO and DB2 commands supported by Mainframe Express, 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 Mainframe Express, 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.

3.6.1 JCL Statements

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

3.6.1.1 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',.......

3.6.1.2 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.

3.7 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.

3.7.1 JCL Statements

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

3.7.1.1 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'

3.7.1.2 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.

3.8 Writing Your Own Utility Programs

You might need to write your own utility programs or obtain them from other software vendors. Mainframe Express 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. Mainframe Express 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 Mainframe Express to ensure that all interactions with the system are handled correctly.


Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousSystem Intelligence Advanced Data Set InformationNext"