Chapter 24: Extensions to JCL and IDCAMS

When running JCL or IDCAMS in Enterprise Server, you can use Micro Focus extensions to the JCL and IDCAMS command languages.

Extensions

You write the extensions as comments, so that if you move your JCL or IDCAMS back to the mainframe they will be ignored. The start of the Micro Focus extensions within a comment is indicated by the four-character string “MFE:”. Extensions are identified by keywords. These keywords begin with the % sign, to avoid any possible conflict with MVS keywords.

There is no change to standard JCL or IDCAMS comments.

%PCDSN

The %PCDSN extension can be used both in JCL and in IDCAMS. You use it when creating a new data set. It specifies a physical PC filename to be associated with the MVS data set name. If you do not use it, a PC filename is generated automatically.

For example, to assign a PC physical filename to a data set you are creating using JCL:

//SYSUT2 DD DSN=MFIDSA.NONVSAM.WITH.SPECIFIC.PCNAME,
//    DISP=(NEW,CATLG),SPACE=(TRK,1)
//*MFE: %PCDSN='<CATALOGFOLDER>\MYFILE.NONVSAM.DAT'

The extension comes after a “//*”, so that the mainframe will see it as a comment. It must be on a line by itself and must follow the last of the DD statement lines to which it applies. The string “<CATALOGFOLDER>”, written exactly as shown, means the folder containing the catalog. The quotes (note: single quotes) surrounding the value are needed if the name does not conform to JCL’s rules; for example, if it contains spaces or lower-case characters.

Note: You can create dynamic PDSs by using this extension syntax as illustrated in the following example:

//DD1      DD DSN='TEST.DYN1',DISP=(NEW,CATLG), 
//            DCB=(RECFM=FB,LRECL=123,DSORG=PO) 
//*MFE: %PCDSN=C:\DPDS\*.DAT

This will create TEST.DYN1 as a dynamic PDS whose members are files in the directory C:\DPDS with the extension .DAT. The data set organization must be PO.

Similarly, to assign a physical PC filename to a data set you are creating using IDCAMS:

DEFINE CLUSTER( -
NAME(DSA.LIB.VSAMSRC2 )        -
CONTROLINTERVALSIZE (4096) -
RECORDSIZE(4088 4088) -
REUSE -
NUMBERED -
SHAREOPTION (4 4) -
CYLINDERS (2 1) -
) -
;MFE:%PCDSN(E:\MYDIR\MYFILE.DAT)

The extension comes after a semicolon, so that the mainframe will see it as a comment. We recommend that it be on a line by itself. Just as in JCL, you can use “<CATALOGFOLDER>” to mean the folder containing the catalog; and single quotes are needed surrounding the value if the name does not conform to IDCAMS’s rules.

To continue the %PCDSN parameter over more than one line, you must following the JCL rules for continuations.

//SYSUT2 DD DSN=MFIDSA.TEST.NONVSAM.WITH.LONG.PCNAME,
// DISP=(NEW,CATLG),SPACE=(TRK,1),LRECL=80,RECFM=F,DSORG=PS
//*MFE: %PCDSN='<CatalogFolder>/DATA/pcname_long_name.node_name3.node_n
//*MFE:        ame4.node_name5.node_name6.node_name7.node_name8.node_na
//*MFE:        me9.with.long.pcname.for.nonvsam.dataset'

In this case, the name begins immediately after "=", goes on until column 71 (there is nothing in column 72), then resumes on the next line at column 16 and so on, finishing with the ending quote. Make sure you have //*MFE: in columns 1 through 7 of all records.

If the name ends exactly in column 71, the only thing left to put in the next line in column 16 is the ending quote:

//SYSUT2 DD DSN=MFIDSA.TEST.NONVSAM.WITH.LONG.PCNAME,
// DISP=(NEW,CATLG),SPACE=(TRK,1),LRECL=80,RECFM=F,DSORG=PS
//*MFE: %PCDSN='<CATALOGFOLDER>/DATA/PCNAME_LONG_NAME.NODE_NAME3.FL.DAT
//*MFE:        '

Finally, if you are using this in IDCAMS, then you follow IDCAMS rules (+ at the end etc. but columns 17/71 do not matter). For example:

DEFINE CLUSTER(NAME(MFIDSA.TEST.VSAMKSDS.WITH.LONG.PCNAME ) -
TRK(1 1) -
RECSZ(80 80) KEYS(9 0) ) -
;MFE:%PCDSN -
('<CatalogFolder>/DATA/pcname_long_name.node_name3.node_t+
ame4.node_name5.node_name6.node_name7.node_name8.node_nam+
e9.with.long.pcname.for.vsamksds.dataset')

%REPRO

The %REPRO extension can be specified on the PARM keyword of the EXEC statement invoking IDCAMS, and on the PARM command. The syntax is:

%REPRO(VSAM | VSAMLAX | OSCOPY | OSCOPYLAX)
AttributeMust match for
RECFMOSCOPY and OSCOPYLAX
DSORGOSCOPY and OSCOPYLAX
VSAM-KEY-OFFSETOSCOPY and OSCOPYLAX
VSAM-KEY-LENGTHOSCOPY and OSCOPYLAX
LRECLOSCOPY and OSCOPYLAX
LRECL-MAX (system managed)OSCOPY and OSCOPYLAX
LRECL-MIN (system managed)OSCOPY and OSCOPYLAX
CHARSET (EBCDIC or ASCII)OSCOPY
EXTENDED-TYPE (system managed. Indicates base cluster, aix, etc.)OSCOPY
REUSE/NOREUSEOSCOPY
UNIQUEKEY/NONUNIQUEKEY (for AIXs and PATHs)OSCOPY

For example:

//STEPAMS  EXEC PGM=IDCAMS,PARM=';MFE:%REPRO(OSCOPY)'
//SYSPRINT  DD SYSOUT=*
//VSAMDATA  DD *
AA
BBB
//SYSIN  DD *
  PARM ;MFE: %REPRO(VSAM)
  /* Next REPRO will use normal REPRO */ 
  REPRO  IFILE (VSAMDATA)                          -
         ODS   (MFIDSA.REPROOS.KSDS1)
  PARM ;MFE: %REPRO(OSCOPY)
  /* All REPRO(s), until another PARM command specifies –
     otherwise, will use OS copy if possible */
  REPRO  IDS   (MFIDSA.REPROOS.KSDS1)              -
         ODS   (MFIDSA.REPROOS.KSDS2)

The extension comes after a semicolon, so that the mainframe will see it as a comment. However, if the extension is the only option to the PARM command, the mainframe reports an error. To prevent this, you must code at least one option in addition to the extension. For example, rather than coding exactly as in the example above, you could code:

PARM='MAR(2,72);MFE: %REPRO(OSCOPY)'

or equivalently:

PARM   MAR(2,72);MFE: %REPRO(OSCOPY)

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