Keyword Descriptions

This section provides a description of each keyword that is listed in the Keyword Abbreviation Table, syntax, examples of the keywords, and a list of the available parameters.
staging
This section provides a description of each keyword that is listed in the Keyword Abbreviation Table, syntax, examples of the keywords, and a list of the available parameters.
2
ACCUM
Use the ACCUM keyword to add single or multiple numeric fields of various types. Each numeric field is totaled separately and each total is printed with the description that you provide. Different numeric fields cannot be added within the same record. For example, all Field-As can be added together, but Field-A cannot be added to Field-B. ACCUM fields with invalid numeric data are not processed. The total number of records in which invalid numeric data was detected is printed. The output, or totals, is printed to ddname SYSTOTAL. If SYSTOTAL is not allocated, the print is directed to SYSPRINT. This keyword can be specified multiple times in a command. The length and data-type parameters are not required, but If you do not specify either or both, the field is assumed to be in packed format. The ACCUM command scans for a valid packed field up to 16 bytes long.
Syntax
ACCUM
(
{
field-
name
|
position[
,length
,
[,
decimal-positions
],
data
-
type
]}[
,'
description
'
]
)
Parameters
ACCUM supports the following parameters:
  • field-name
    Use
    field-name
    when referencing a data field that is defined in the layout of the record. The record layout must be available to the application job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE. When this parameter is specified, the keyword position, length, decimal-positions, and data type are all retrieved from the
    field-name
    definition.
  • position
    Specifies the position in a record. Specify one of the following values:
    1 - 32760 -- The actual position location
    +nnn or - nnn -- The relative position to the current location of the record.
  • length
    Specifies the length of the field to accumulate. If this parameter is set to 0 or if the parameter is not specified, the data-type must be packed or omitted. If you specify 0, the first valid packed field that is located is used. Valid byte lengths depend on the data-type.
  • decimal-positions
    Specifies the number of positions to the right of the decimal point. If this parameter is not specified or is set to 0, no decimal points are used. Valid values depend on the data-type and length.
    Numeric characters
    - must be equal to or less than the length of the numeric field.
    Binary
    - must be equal to or less than the size of the number that can be contained in the binary field.
    1 byte - maximum of three decimal positions
    2 bytes - maximum of five decimal positions
    3 bytes - maximum of eight decimal positions
    4 bytes - maximum of ten decimal positions
    Packed
    - (2N - 1) where N is the number of digits
  • data-type
    Specify one of the following values:
    B
    -- Binary unsigned (length value 1 - 8 bytes)
    N
    -- Numeric characters (length value 1 - 31 bytes)
    P
    -- Packed decimal (length value 1 - 16 bytes)
    R --
    Report (length value 1 - 31 numeric characters, plus appropriate commas and optional decimal place)
    S --
    Signed binary (length value 1 - 8 bytes)
    Note:
    When this parameter is not specified, the data-type is assumed to be in packed decimal format.
  • description
    Specifies a text description (maximum length of 40 characters)
Example 1
This keyword accumulates the 4-byte packed field starting in position 10. The description field is used for the total line title.
READ,
  ACCUM(10,4,P,'POSITION 10')
 A C C U M   S U M M A R Y   
                             
Description   Total   Records
                             
POSITION 10      -6         3
Example 2
This next example shows the previous example when invalid data is detected.
          A C C U M   S U M M A R Y           
                                              
Description   Total   Records   Invalid Values
                                              
POSITION 10      -4         2                1
Example 3
This example accumulates separately the two packed fields, Field-One and Field-Two. The description fields are used for the total line titles.
READ,
  LAYOUTFILE(LAYOUT),
  ACCUM(FIELD-ONE,'TOTAL FIRST-FIELD'),
  ACCUM(FIELD-TWO,'TOTAL-SECOND-FIELD')
       A C C U M   S U M M A R Y         
                                         
Description              Total   Records 
                                         
Total First-Field      -6.9865         3 
Total Second-Field          15         3
Example 4
The default TOTAL serves as the total line title when the description field is omitted. Because the
data-type
parameter is omitted, the data beginning at position for length of 5 is assumed to be valid packed numeric.
READ,
  ACCUM(76,5),
  ACCUM(81,5)
 A C C U M   S U M M A R Y    
                              
Description   Total   Records 
 
TOTAL            -6         3 
TOTAL            15         3
Example 5
This example sets the number of decimal positions to the right of the decimal point for a binary halfword field.
READ,
  ACCUM(5,2,2,B,C'BINARY DECIMAL')
You could obtain the same results by simply referencing the field-name that is described by the
position
,
length,
and
decimal-positions
parameters.
READ,
  ACCUM(FIELD-ONE,C'BINARY DECIMAL')
    A C C U M   S U M M A R Y      
                                   
Description        Total   Records 
                                   
BINARY DECIMAL   1.31070         2  
Example 6
The record is scanned for the value TOTALS. When it is found at record location 45, the numeric values at locations 52, 55, and 59 respectively are accumulated.
READ,
  IF(1,80,EQ,C'TOTALS'),
    ACCUM(+7,3,N,'CUSTOMER SALES'),
    ACCUM(+11,3,N,'CUSTOMER RETURNS'),
    ACCUM(+14,3,N,'CUSTOMER COMPLAINTS')
ADDCNTL
Use the ADDCNTL keyword to include or omit a member separator. This keyword is only valid with the COMPARE, COPY, and READ commands under the following conditions:
  • When comparing PDS members and writing compared records to a sequential file
  • When copying PDS members to a sequential file
  • When reading PDS members and writing records to a sequential file
Syntax
ADDCNTL(N | Y | S)
Parameters
ADDCNTL supports the following parameter values:
  • N
    Do not insert the member separator between PDS members' data in a sequential file.
    ./ ADD NAME=mbrname
  • Y
    (Default) Insert the member separator between PDS members' data in a sequential file.
    .
    / ADD NAME=mbrname
  • S
    Insert a line that identifies the PDS member, with the first 72 characters that are filled in as follows:
    • An asterisk in the first character position
    • A variable number of > characters
    • One blank space
    • DSN= followed by the full name of the PDS member
    • One blank space
    • A variable number of < characters
    • An asterisk in the last character position
    The DSN name is centered in the 72 character line. The number of > and < characters varies to fill the line dependent on the length of the DSN name.
Example
This example does not insert any member separator between members in the sequential output file.
COPY,
  MEMBER(*),
  ADDCNTL(N),
  INFILE(PDSFILE),
  OUTFILE(PSFILE)
CHANGE
Use the CHANGE keyword to change the value of consecutive bytes in a data-type file.
The length of the
to-data
and
from-data
lengths can be different. The data to the right of the
from-data
is shifted left or right to account for the difference in length. These changes can impact the data structure and can result in lost data. Use the REPLACE command to maintain record field integrity, because REPLACE does not shift data. When the
field-name
parameter is specified, both
to-data
and
from-data
are padded to the defined length of the 
field-name
, and no shifting of data occurs.
When used with the COPY or GENXML command, the final variable record length can be different from its original length if the
to-data
is greater or less than the
from-data
, and the defined length of the record allows for the different record length.
When used with the UPDATE command, the final variable length of the record remains unchanged.
If the new record length is valid for the file, the new record is written with the new length. If the new length is less than the minimum allowable record length, the new record rightmost bytes are padded with a character as specified by the PADCHAR keyword. The default value is x'00'. If the new length is greater than the maximum allowable record length, the data past the maximum record length is lost.
For fixed record lengths, the record is padded as described for variable lengths when the new record length is less than the required record length. The data is lost if the new length is greater than the record length.
When the data is truncated, the command returns a condition code equal to the value of the keyword TRUNCRC. You can specify the TRUNCRC or can use the &BAT_TRUNCRC default value.
Note:
When changing pack data, the sign code is maintained. 
Syntax
CHANGE({
field-name
|
position
[,
scan-length
]},
operator,from-data,to-data
[,ALL]
Parameters
CHANGE supports the following parameters:
  • field-name
    Use
    field-name
    when referencing a data field that is defined in the record layout. The layout must be available to the application job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE. When this parameter is specified, the keyword position, length, decimal positions, and data type are retrieved from the field-name definition and are used to validate the from-data and to-data formats. 
  • position
    Specifies the starting field position in a record. Valid choices are:
    1 - 32760
    -- The actual position number
    +nnn
    or 
     - nnn
    -- The relative position to the current location of the record.
  • scan-length
    Specifies the amount of data to scan. When
    scan-length
     is set to 0, the entire record starting at the
    position
    value is scanned. Valid values are 0 - 32760. If the
    scan-length
    is omitted, no scanning is done.
  • operator
    Specify one of the following values:
    CO
    -- Contains - If a
    field-name
    is specified, the
    position
    and
    scan-length
    values are retrieved from the defined starting position of the 
    field-name
      and physical length. If
    position
    and
    scan-length
    are specified, the record is scanned for the
    data
    beginning at
    position
    for a length of
    scan-length
    .
    EQ
    -- Equal
    NE
    -- Not equal
    GT
    -- Greater than
    GE
    -- Greater than or equal
    LE
    -- Less than or equal to
    LT
    -- Less than
  • from-data
    Specify one of the following values:
    C'c…'
    -- Character - matches specified case
    N'n…'
    -- Numeric - processes the literal as defined by the
    field-name
    parameter. The
    field-name
    parameter must be defined as a numeric field, and is only valid when a
    field-name
    parameter is supplied.
    P'n…'
    -- Packed
    T'c…'
    -- Text - matches both lowercase and uppercase alphabetic characters. Alphanumeric characters are permitted.
    X'hh…'
    -- Hexadecimal
  • to-data
    Specify one of the following values:
    C'c…'
    -- Character - matches specified case
    N'n…'
    -- Numeric - processes the literal as defined by the
    field-name
    parameter. This parameter is only valid when a
    field-name
    parameter is supplied.
    P'n…'
    -- Packed
    T'c…'
    -- Text - uppercase letters are substituted for their lowercase counterparts. Alphanumeric data is permitted.
    X'hh…'
    -- Hexadecimal
  • ALL
    Changes every occurrence in the record within the
    scan-length
    . Otherwise only the first occurrence of the
    from-data
    is changed. The
    scan-length
    parameter must be present if this parameter is specified.
Example 1
This example syntax changes the character string '706' starting at position 62 to '859'.
CHANGE(62,EQ,C'706',C'859')
Example 2
This example syntax changes the halfword
field-name
field values of X'0010' to X'00A0'.
CHANGE(FIELD-NAME,EQ,X'0010',X'00A0')
If field-name was defined as a packed field of any length, up to 31 digits, only values of a P'16' would be changed to a P'160'. No data shifting would take place.
UPDATE,
  CHANGE(FIELD-NAME,EQ,P'16',P'160')
Example 3
This example syntax changes the first occurrence of the string '706' to '859' starting at position 62 and ending at position 112.
UPDATE,
  CHANGE(62,50,EQ,C'706',C'859')
Example 4
This example syntax changes all occurrences of the string 'STREET' to the string 'ST'. For each CHANGE, the data to the right of the
from-data
is shifted left 4 bytes. If the record length allows for the new record length, the length is adjusted so, and the record is written with the shorter length. If the record length does not allow for a smaller record, the PADCHAR keyword value, in this example, space, initializes the four uninitialized bytes.
UPDATE,
  CHANGE(1,0,EQ,C'STREET',C'ST',ALL),PADCHAR(C' ')
Example 5
When changing packed data to signed packed data, the current sign of the packed data is maintained. In the following example, both packed values, x'1C' and x'1F' are changed to x'5C' and x'5F' respectively.
UPDATE,
  CHANGE(62,EQ,P'1',P'+5')
The same results could be obtained by using the signed 1-byte packed field,
field-name,
at position 62.
UPDATE,
  CHANGE(SIGNED-PACKED-FIELD,EQ,N'1',N'+5')
Example 6
In the next example, each record is scanned for the value 'TOTALS'. When it is located, at record position 45, it is changed to 'COUNTS' in the output file and the values at record position 52, 63 and 77 change to '110', '120' and '130' respectively.
COPY,
 IF(1,0,C'TOTALS'),                  
  CHANGE(+0,EQ,C'TOTALS',C'COUNTS'),
  CHANGE(+7,3,NE,C'110',C'110'),   
  CHANGE(+11,3,NE,C'120',C'120'),  
  CHANGE(+14,3,NE,C'130',C'130')
CHANGED
The CHANGED keyword specifies the output file to which the changed records are written. It is only valid with the COMPARE command and can be used twice in a command.
With COMPARE PROGRAM, the file must have a variable blocked record format with a maximum record length of at least 2048 bytes.
Syntax
CHANGED(
ddname
[,ALL|,NEW|,OLD])
Parameters
CHANGED supports the following parameters:
  • ddname
    The one to eight-character ddname of the sequential file in which the changed records are written.
  • ALL
    (Default) All changed records in both the old and new file are written the ddname.
  • NEW
    Only changed records from the new file are written the ddname.
  • OLD
    Only changed records from the old file are written the ddname.
Example
This example syntax writes both the old and new file records that have been identified as being changed to the sequential file referenced by ddname CHGRECS.
COMPARE
   CHANGED(CHGRECS,ALL)
COMPDIFF
The COMDIFF keyword sets the maximum number of mismatches that are allowed before the COMPARE command is terminated. (Mismatches are defined as inserted, deleted, and changed records.) COMPDIFF is only valid with the COMPARE command. When the COMPDIFF limit is reached, that record processing is completed, and the command terminates. The shipped default value for COMPDIFF is 0, which sets no maximum limit, but the default value may have been changed during product installation by updating the &BAT_COMPDIFF option.
Syntax
COMPDIFF(0 | 
number
)
Parameters
COMPDIFF supports the following parameter:
  • number
    Any integer value from 0 through 99999. The default value is 0 and means that there is no limit to mismatches before terminating the COMPARE command.
Example
This example syntax allows for 10,000 mismatches before the COMPARE is terminated. The command is terminated after processing the 10,000th mismatched record.
COMPARE COMPDIFF(10000)
COMPRC
The COMPRC keyword sets the return code for the COMPARE command if all records do not match. This keyword is only valid with the COMPARE command. The shipped default value for COMPRC is 4, but it may have been changed by updating the &BAT_COMPRC installation option.
Syntax
COMPRC(4 | 
return-code
)
Parameters
COMPRC supports the following parameter:
  • return-code
    Any integer value from 0 through 4095. The default value is 4, but it may have been changed by updating the &BAT_COMPRC installation option.
Example
Returns a job-step return code of 40 if one or more mismatches are found.
COMPARE,
COMPRC(40)
COMPREPORT
The COMPREPORT keyword controls which records get printed, if any, for the COMPARE command.
Syntax
COMPREPORT(A | M | S)
Parameters
COMPREPORT supports the following values:
  • A
    All records in the file are printed, flagging mismatched data.
  • M
    Mismatched records only are printed. This includes inserted, deleted, and changed records. Mismatched data in the changed records are flagged.
  • S
    Summary report only is printed.
Default:
M
Example 1
This example syntax produces the following report, in which all records processed are printed.
COMPARE,
  COMPREPORT(A)
Compare Report             Old File  CUSTOMER.OLDFILE                       Rec Length = 80
                           New File  CUSTOMER.NEWFILE                       Rec Length = 80
                                                                               
Match                pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
  Old Rec #1           1 Intl Widget         534 Commerce Way              Denver    CO
  New Rec #1                                                                    
                                                                                
Change               pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
  Old Rec #2           1 Acme Widgets        974 EZ Street                 Miami     FL
  New Rec #2           1 Acme Widgets        1627 Helen Ave.               Jupiter   FL
                                             ***************               *******
                                                                                
Delete               pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
  Old Rec #3           1 CT Widgets          8021 Hartford Blvd            FarmingtonCT
                                                                                                                 
                           S U M M A R Y   R E P O R T                          
                                                                                
                           Old Records Read  3                                  
                           New Records Read  2                                  
                                                                                
                           Records Matched   1                                  
                           Records Changed   1                                  
                           Records Inserted  0                                  
                           Records Deleted   1                                  |
                                                                                
                                                                                
                                                                                
The following files are compared:                                               
                                                                                
          DDNAME    DSN                                                 
   OLD => SYSUT1    CUSTOMER.OLDFILE
   NEW => SYSUT1C   CUSTOMER.NEWFILE
                                                                        
All records on OLD and NEW files are reported with mismatches identified.        
Records are displayed in character format.                             
For changed records, only lines that contain differences are displayed.
Example 2
This example syntax produces the following report, in which only mismatched, inserted, and deleted records are printed.
COMPARE,
COMPREPORT(M)
Compare Report             Old File  CUSTOMER.OLDFILE   Rec Length = 80
                           New File  CUSTOMER.NEWFILE   Rec Length = 80
                                                                               
                                                                               
Change                   Old & New Record Length = 62                           
                     pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
  Old Rec #2           1 Acme Widgets        974 EZ Street                 Miami     FL
  New Rec #2           1 Acme Widgets        1627 Helen Ave.               Jupiter   FL
                                             ***************               *******
                                                                                
Insert                   New Record Length = 62                                 
                     pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
  New Rec #3           1 MA Widgets Co.      981 Springfield Blvd          Chicopee  MA
                                                                                                                              
                                                                                
                           S U M M A R Y   R E P O R T                          
                                                                                
                           Old Records Read  2                                  
                           New Records Read  3                                  
                                                                                
                           Records Matched   1                                  
                           Records Changed   1                                  
                           Records Inserted  1                                  
                           Records Deleted   0                                  
                                                                                
                                                                                
The following files are compared:                                               
                                                                                
          DDNAME    DSN                                                 
   OLD => SYSUT1    CUSTOMER.OLDFILE        
   NEW => SYSUT1C   CUSTOMER.NEWFILE        
                                                                        
 Mismatched records (inserts, deletes, and changes) are reported.       
 Records are displayed in character format.                             
 For changed records, only lines that contain differences are displayed.                                                       
Example 3
This example syntax produces the following report, in which only a summary report is printed.
COMPARE,
  COMPPREPORT(S)
Compare Report             Old File  CUSTOMER.OLDFILE   Rec Length = 80
                           New File  CUSTOMER.NEWFILE   Rec Length = 80
                                                                               
                                                                               
                           S U M M A R Y   R E P O R T                         
                                                                               
                           Old Records Read  2                                 
                           New Records Read  2                                 
                                                                               
                           Records Matched   1                                 
                           Records Changed   1                                 
                           Records Inserted  0                                 
                           Records Deleted   0                                 
                                                                               
                                                                               
                                                                               
The following files are compared:                                              
                                                                               
           DDNAME    DSN                                                       
    OLD => SYSUT1    CUSTOMER.OLDFILE                       
    NEW => SYSUT1C   CUSTOMER.NEWFILE                       
                                                                                
  Only the summary report is written.                                                                
CSECT
The CSECT keyword specifies a CSECT cross-reference report for the LOADINFO command. This keyword is only valid with the LOADINFO command and can only be used once per command. The CSECT keyword produces a cross-reference report of each CSECT in a load library, listing all the load modules in which the CSECT is included.
Syntax
CSECT
Example
This example creates a CSECT cross-reference report for all CSECTS in a load library, listing all the load modules in which the CSECT is included. The load library that is referenced by the ddname LOADLIB is used.
LOADINFO,
     CSECT
CSECTCOMPARE
The CSECTCOMPARE keyword controls how CSECTs are compared. Possible values are BYNAME and BYORDER.
Syntax
CSECTCOMPARE(BYNAME|BYORDER)
Parameters
CSECTCOMPARE supports the following parameters:
  • BYNAME
    (Default) CSECTs with identical names are compared. CSECTs that only exist in the old file are reported as deleted. CSECTs that only exist in the new file are reported as inserted.
  • BYORDER
    CSECTs are compared in the order in which they appear in the program.
Example
This example compares the CSECTs of two programs by name, not by the order in which they appear in the program.
COMPARE PROGRAM,
  CSECTCOMPARE(BYNAME)
CSECTEXCLUDE
The CSECTEXCLUDE keyword specifies which CSECTs should be excluded from command processing. This keyword is only valid with the LOADINFO and COMPARE PROGRAM commands. It can only be used once per command. For LOADINFO, it is mutually exclusive with the CSECTINCLUDE keyword.
By default, no CSECTs are excluded form command processing.
Syntax
CSECTEXCLUDE({
csect
 | 
pattern
 | startcsect-endcsect }[,…])
Parameters
CSECTEXCLUDE supports the following parameters:
  • csect
    CSECT name that is excluded from processing
  • pattern
    Specifies a pattern. CSECT names that match this pattern are excluded from processing.
    * -- An asterisk signifies any number of characters starting in this position.
    % -- A percent sign is a placeholder for a character in the specific position.
  • startcsect
    Specifies the starting CSECT name when identifying a range of CSECTs to exclude from processing. Specify an asterisk (*) to exclude all CSECTs less than the endcsect. Startcsect can be any valid pattern name.
  • endcsect
    Specifies the ending CSECT name when identifying a range of CSECTs to exclude from processing. Specify an asterisk (*) to exclude all CSECTs greater than the startcsect. Endcsect can be any valid pattern name.
Example
This example creates a CSECT cross-reference report of all CSECTs in a load library excluding all CSECTs beginning with CEE.
LOADINFO,
  CSECTEXCLUDE(CEE*), 
  CSECT
CSECTINCLUDE
The CSECTINCLUDE keyword specifies which CSECTs should be included in command processing. The keyword is only valid with the LOADINFO and COMPARE PROGRAM commands. It can only be used once per command. For LOADINFO, it is mutually exclusive with the CSECTEXCLUDE keyword.
By default, all CSECTs are included in command processing.
Syntax
CSECTINCLUDE({
csect
 | 
pattern
 | startcsect-endcsect}[,…])
Parameters
CSECTINCLUDE supports the following parameters:
  • csect
    CSECT name that is selected for processing
  • pattern
    Specifies a pattern. CSECT names that match this pattern are selected for processing.
    * -- An asterisk signifies any number of characters starting in this position.
    % -- A percent sign is a placeholder for a character in the specific position.
  • startcsect
    Specifies the starting CSECT name when identifying a range of CSECTs to select for processing. Specify an asterisk (*) to select all CSECTs less than the endcsect. Startcsect can be any valid pattern name.
  • endcsect
    Specifies the ending CSECT name when identifying a range of CSECTs to select for processing. Specify an asterisk (*) to select all CSECTs greater than the startcsect. Endcsect can be any valid pattern name.
Example
This example creates a CSECT cross-reference report for the DATERTN and TIMERTN CSECTs, listing, by CSECT, all the programs using each CSECT.
LOADINFO,
  CSECTINCLUDE(DATERTN,TIMERTN), 
  CSECT
DELETED
The DELETED keyword specifies the output file to which deleted records are written. It is only valid with the COMPARE command and can only be used once per command.
With COMPARE PROGRAM, the file must have a variable blocked record format with a maximum record length of at least 2048 bytes.
Syntax
DELETED(
ddname
)
Parameters
DELETED supports the following parameters:
  • ddname
    The one to eight-character ddname of the sequential file in which all the DELETED records are written.
Example
This example syntax writes the old file records that do not exist in the new file to the sequential file referenced by ddname DELTRECS.
COMPARE
    DELETED(DELTRECS)
DIRECTION
The DIRECTION keyword identifies the direction in which the data set is read. The DIRECTION keyword can only be used once per command and is only valid with the commands COPY, GENXML, PRINT, READ, and UPDATE.
Syntax
DIRECTION(FORWARD | BACKWARD)
Parameters
DIRECTION supports the following parameter:
  • directional-value
    Direction in which the file is to be processed. The valid values are as follows:
    • FORWARD or F
      (Default) Reads the file in a forward direction. For a KSDS, this is in an ascending key sequence.
    • BACKWARD or B
      Reads the file in a backward direction. For a KSDS, this is in a descending key sequence. No input file concatenation is permitted when using this parameter value.
When processing a PDS and using the BACKWARD
directional-value
, the members are processed in ascending order, but the member records are processed from the last physical record to the first.
Example 1
In the following example for a KSDS, processing starts at the record with a key, or partial key value, of C'01234', and the KSDS is processed in descending keys from that point. If key C'01234' does not exist, processing starts from the next highest record key.
COPY, 
  DIRECTION(BACKWARD),
  RID(C'01234')
DIRREPORT
The DIRREPORT keyword controls the directory report when comparing PDS members. This keyword is valid only with the COMPARE command.
Syntax
DIRREPORT(A|M|S)
Parameters
DIRREPORT supports the following parameters:
  • A
    All sections of the directory report are displayed.
  • M
    Only those sections of the directory report that identify mismatched members are displayed.
  • S
    Only a directory summary report is displayed.
Default:
M
Example
This example syntax requests a summary directory report.
COMPARE,
  DIRREPORT(S),
  OLDFILE(MY.OLD.PDS),
  NEWFILE(MY.NEW.PDS)
DSN
The DSN keyword identifies the data set name or pattern that is used during DSNINFO processing. This keyword is valid only with the DSNINFO command.
Syntax
DSN([
dsname
] | [
pattern
])
Parameters
DSN supports the following parameters:
  • dsname
    A high level qualifier that identifies the data sets to be selected. This is dynamically allocated. A JCL is not required to reference this dsname.
  • pattern
    A mask that is used to select the data sets for display. Any data set names that match this pattern is selected.
    * -
    An asterisk signifies any number of characters starting in this position.
    % -
    A percent sign is a placeholder for a character in the specific position.
Example
This example syntax lists DSN information for all files with the high level qualifier of CA.FMMVS41.EXECS.
DSNINFO,
  DSN(CA.FMMVS90.EXECS)
EDIT
The EDIT keyword changes data in a text
-
type record.
From-data
and
to-data
can be unequal in length.
When the length of the
to
-data
is longer than the length of the
from-data
, the non-blank characters to the right of the
from-data
are shifted right. Repeating space characters, x'40', anywhere to the right of the
from-data
 are removed to make room for the longer length. Shifted data may be lost if the record length does not allow for expansion.
When the length of the
to-data
is shorter than the length of the
from-data
, no shifting takes place. Blank characters, x'40', are inserted after the changed data to make up the difference in length between the
to-data
 and
from-data
.
Syntax
EDIT({
field-
name|position[
scan-length
]}
,
operator,from-data,to-data
[,ALL])
Parameters
EDIT supports the following parameters:
  • field-name
    Use
    field-name
    when referencing a data field that is defined in the record layout. The layout must be available to the application job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE. When this parameter is specified, the keyword position, length, decimal-positions, and data type are retrieved from the field-name definition and are used to validate the from-data and to-data formats. 
  • position
    The position in a record. Valid choices are the following:
    • 1 - 32760
      Specifies the actual position number.
    • +nnn or -nnn
      Specifies the relative position to the current location of the record. 
  • scan-length
    Specifies the amount of data to scan. When
    scan-length
    is set to 0 means, the entire record starting at the position parameter value is scanned. Valid values are 0 - 32760. If the
    scan-length
    is omitted, no scanning is done.
  • operator
    Specify one of the following values:
    • CO
      Contains -- If a
      field-name
      is supplied, the
      position
      and
      scan-length
      values are retrieved from the defined starting position and physical length of the 
      field-name
      . If
      position
      and
      scan-length
      are supplied, the record is scanned for the
      data
      beginning at
      position
      for a length of
      scan-length
      .
    • EQ
      Equal
    • NE
      Not equal
    • GT
      Greater than
    • GE
      Greater than or equal to
    • LE
      Less than or equal to
    • LT
      Less than
  • from-data
    Specify one of the following values:
    • C'c…
      '
      Character -- matches specified case
    • N'n…
      '
      Numeric -- processes the literal as defined by the
      field-name
      parameter. The
      field-name
      parameter must be defined as a numeric field, and it is only valid when a
      field-name
      parameter is supplied.
    • P'n…
      '
      Packed
    • T'c…
      '
      Text -- matches both lowercase and uppercase alphabetic characters. Alphanumeric characters are permitted.
    • X'hh…
      '
      Hexadecimal
  • to-data
    Specify one of the following values:
    • C'c…
      '
      Character -- matches specified case
    • N'n…
      '
      Numeric -- processes the literal as defined by the
      field-name
      parameter. The
      field-name
      parameter must be defined as a numeric field, and it is only valid when a
      field-name
      parameter is supplied.
    • P'n…
      '
      Packed
    • T'c…
      '
      Text -- uppercase letters are substituted for their lowercase counterparts. Alphanumeric data is permitted.
    • X'hh…'
      Hexadecimal
  • ALL
    Changes every occurrence in the record within the scan-length. Otherwise only the first occurrence of the from-data is edited. The
    scan-length
    parameter must be present if the ALL parameter is specified.
Example 1
Replaces all occurrences of the value 'DSNAME=' with the value 'DSN=.'. Because EDIT is used to change text type data, data is shifted to the left until a double space is found and padded with the PADCHAR value spaces.
UPDATE,
  EDIT(1,0,C'DSNAME=',C'DSN=',ALL),PADCHAR(C' ')
Example 2
This example changes replaces all occurrences of C'John X     ' with C'Jonathan X' in a field with a fixed length of 10 that is padded with blanks. The non-blank characters to the right of the
from-data
are shifted right.
UPDATE,
  EDIT(1,0,C'John',C'Jonathan',ALL)
EMPTYRC
The EMPTYRC keyword sets the command return code if an empty input file is detected. The shipped default value is 4, but this may have been changed during installation by updating the &BAT_EMPTYRC option.
Syntax
EMPTYRC(4 | 
return-code
)
Parameters
EMPTYRC supports the following parameter:
  • return-code
    An integer value from 0 through 4095
Example
This command combination identifies whether there are any new customers and returns a condition code of 8 if there are none. This is accomplished by comparing the key values of the two files, POS(CUST-KEY). The EMPTYRC sets a return code of 8 when there are no new, inserted, records into the NEWCUSTS file, otherwise the return code is set to 0.
COMPARE,
  OLDFILE(OLDMSTR),
  NEWFILE(NEWMSTR),
  LAYOUTFILE(USER.COPYLIB(CUSTMSTR)),
  POS(CUST-KEY),            
  COMPRC(0),                
  INSERTED(NEWCUSTS)
READ,
  INFILE(NEWCUSTS).
  INLIM(1),
  EMPTYRC(8)
FIELDDISPLAY
The FIELDDISPLAY keyword controls which of the mismatched record fields or POSITION parameters are printed. FIELDDISPLAY is only valid with the COMPARE and PRINTLOG commands.
Syntax
FIELDDISPLAY(A | M)
Parameters
FIELDDISPLAY supports the following values:
  • A
    Displays all fields or POSITION parameters in mismatched records.
  • M
    Displays only those fields or POSITION parameters that contain mismatches in mismatched records.
Default:
M
Example
In this example, FIELDDISPLAY prints only the mismatched fields of that record. For matching records all fields are printed.
COMPARE,
  COMPREPORT(A),
  FIELDDISPLAY(M), 
  FORMAT(SINGLE),
  LAYOUTFILE(CUSTOMER.COPYBOOK(CUSTREC))
Compare Report             Old File  CUSTOMER.OLDFILE               Rec Length = 80
                           New File  CUSTOMER.NEWFILE               Rec Length = 80
                                                                                
Match                                             Old Rec #1                              New Rec #1    
Pos   *----------FIELD NAME-------------* FORMAT  *---+----1----+----2----+----3----+----4 *---+----1----+----2----+----3----+----4
    1 01 COMPANY-DATA                          80                               
    1   03 COMPANY-NAME                   C    20 Intl Widget                   
   21   03 COMPANY-ADDRESS                C    30 534 Commerce Way              
   51   03 COMPANY-CITY                   C    10 Denver                        
   61   03 COMPANY-STATE-CODE             C     2 CO                            
   63   03 FILLER                         C    18                               
                                                                                
Compare Report             Old File  CUSTOMER.OLDFILE               Rec Length = 80
                           New File  CUSTOMER.NEWFILE               Rec Length = 80 
                                                                                
Change                                            Old Rec #2                              New Rec #2    
Pos   *----------FIELD NAME-------------* FORMAT  *---+----1----+----2----+----3----+----4 *---+----1----+----2----+----3----+----4
   21   03 COMPANY-ADDRESS                C    30 974 EZ Street               1627 Helen Ave.                   
   51   03 COMPANY-CITY                   C    10 Miami                                   Jupiter   
 
                                                                                
                                                                                
                                                                                
                                                                                
                           S U M M A R Y   R E P O R T                          
                                                                                
                           Old Records Read  2                                  
                           New Records Read  2                                  
                                                                                
                           Records Matched   1                                  
                           Records Changed   1                                  
                           Records Inserted  0                                  
                           Records Deleted   0                                  
                                                                                
                                                                                
                                                                                
The following files are compared:                                               
                                                                                
           DDNAME    DSN                                                        
    OLD => SYSUT1    CUSTOMER.OLDFILE               
    NEW => SYSUT1C   CUSTOMER.NEWFILE               
                                                                                
  All records on OLD and NEW files are reported with mismatches identified.     
  Record display is single record formatted with line(s) for each field.        
  For changed records, only fields which are different are displayed.                                                                         
FORMAT
The FORMAT keyword controls the formatting of the record data. Use the FORMAT keyword to print the data in character, hex, list, or single record formats. Character is the default format. The list format is only valid with the PRINT command.
Syntax
FORMAT(CHARACTER | HEX | LIST | SINGLE | INSTRUCTION)
Parameters
FORMAT supports the following parameter:
  • Format-value
    Specify one of the following valid:
    • CHARACTER
      or
      C
      Prints the selected records in character format with scale and record numbers.
    • HEX or H
      Prints the selected records in vertical hex format.
      Note:
      This option is not available when using the COMPARE command with the PROGRAM keyword.
    • INSTRUCTION
      or
      I
      Prints the compared records in machine instruction format.
      Note:
      This option is only available when using the COMPARE command with the PROGRAM keyword and applies only to records related to the CONTENT property.
    • LIST
      or
      L
      Prints the selected records in character format without scale and record numbers. This option is only available with the PRINT command.
    • SINGLE
      or
      S
      Prints the selected records in single record format according to the copybook that you specified. Except for the PRINTLOG command, the copybook must be supplied through either the LAYOUTFILE keyword or the default LAYOUT ddname.
    Default:
    C
Example 1
This example syntax prints the data in vertical hex format, as shown in the following sample report.
PRINT,
  FORMAT(HEX)
Print Report                 DSN =CUSTOMER.FILE                Rec Length = 80  
                                                                                
Rec #1                                                                          
   pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
     1 Intl Widget         534 Commerce Way              Denver    CO           
       C9A94E8888A444444444FFF4C99989884E8A44444444444444C89A894444CD444444444444444444           
       95330694753000000000534036445935061800000000000000455559000036000000000000000000
                                                                                
Rec #2                                                                          
   pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
     1 Acme Widgets        974 EZ Street                 Miami     FL           
       C8984E8888AA44444444FFF4CE4EA988A44444444444444444D889844444CD444444444444444444
       13450694753200000000974059023955300000000000000000491490000063000000000000000000                               
Example 2
This example syntax prints the data in list format, as shown in the following sample report.
PRINT,
  FORMAT(LIST)
Print Report                 DSN =CUSTOMER.FILE                Rec Length = 80  
                                                                                
Intl Widget         534 Commerce Way              Denver    CO
Acme Widgets   974 EZ Street                        Miami     FL                    
GENERATION
Use the GENERATION keyword to process the generations of PDSE V2 library members.
Only one GENERATION keyword per command is accepted. At least one MEMBER keyword is also required.
Syntax
GENERATION(value_1,value_2)
Parameters
GENERATION supports the following parameters.
In the COMPARE command:
  • value_1
    Specifies the generation number of the old member(s).
  • value_2
    Specifies the generation number of the new member(s).
Both values are required and are numbers with an allowed range of -200000000 to 200000000.
A negative value indicates a relative generation number.
A positive value indicates an absolute generation number.
A value of 0 indicates the current level of a PDSE V2 library member, or that the data set is a PDS or PDSE V1 member. If you specify 0 for both values, the keyword is ignored and a PDS member comparison is performed.
In the READ and COPY commands:
  • value_1
    • Specify * to process the current level and all generations of the member(s).
    • Specify 0 to process the current level.
    • A positive value in the range 1 to 2000000000 specifies an absolute generation number to process.
    • A negative value in the range -2000000000 to -1 specifies a relative generation number below the current level to process.
  • value_2
    Only specify this parameter for a READ command where value_1 is 0. Do not specify value_2 for a COPY command.
    Specifies the number of generations below the current level to be processed. The current level is processed first, then each generation one by one until the requested number of generations is reached or no more generations exist.
Example 1
This keyword in a COMPARE command specifies the generation with absolute number 10 of the old PDSE V2 library member and the generation with absolute number 12 of the new PDSE V2 library member.
GENERATION(10,12)
Example 2
This keyword in a COMPARE command specifies the generation with relative number -1 of the old PDSE V2 library member and the current generation of the new PDS, PDSE or PDSE V2 library member.
GENERATION(-1,0) 
Example 3
This keyword in a READ or COPY command specifies the current level and all generations for members in a PDSE V2 library.
GENERATION(*)
Example 4
This keyword in a READ command specifies the current level and up to 5 generations below the current level for members in a PDSE V2 library.
GENERATION(0,5)
Example 5
This keyword in a READ or COPY command specifies the generation with the absolute number 99 for members in a PDSE V2 library.
GENERATION(99)
Example 6
This keyword in a READ or COPY command specifies the generation with the relative number -1 for members in a PDSE V2 library.
GENERATION(-1)
IF, AND, OR
Use the IF keyword to identify when to take further actions or processing. IF is different from SELRECIF and SELMEMIF in that IF defines a condition that requires further processing. SELRECIF and SELMEMIF select records or PDS members for processing by a specified command.
The AND/OR keywords are only valid immediately following the IF, SKIPRECIF, SELRECIF, and SELMEMIF keywords.
When an IF keyword immediately follows another IF/AND/OR keyword, the second IF is treated like an AND statement.
When IFs are separated by actions, subsequent IFs are not subordinate to the previous IF. The last action and the STOP keyword are subordinate to an IF/AND/OR ends the IF/AND/ORs actions.
Syntax
IF({field-name|position[,scan-length]},operator,data[,…])
       ({   
field-name
|
position,scan-length
},
data-type
[,…])
IF({
field-name
|
position,scan-length
},
operator
,{
field-name
|
position
})
AND({field-name|position[,scan-length]},operator,data[,…])
   ({
field-name
|
position,scan-length
},
data-type
[,…])
AND({
field-name
|
position,scan-length
},
operator
,{
field-name
|
position
})
OR({field-name|position[,scan-length]},operator,data[,…])
  ({field-name|position,scan-length},data-type[,…])
OR({field-name|position,scan-length},operator,{field-name|position})
Also use the data definition to imply an OR condition. If the data and position are the same, but the values different, change the data. This example looks for either character string LEAWOOD or MERRIAM' at record locations 40 - 54.
IF(40,14,EQ,C'LEAWOOD,MERRIAM')
When the data are not the same, you can still use an implied OR by simply listing the different data values.
IF(40,14,EQ,C'LEAWOOD',T'Merriam')
Or, you can append other criteria directly after the current criteria. This format ORs the two conditions.
IF(40,14,EQ,C'LEAWOOD',60,14,T'Merriam')
Parameters
IF supports the following parameters:
  • field-name
    Use
    field-name
    when referencing a data field that is defined in the record layout. The layout must be available to the application job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE. When this parameter is specified, the keyword position, length, decimal-positions, and data type are all retrieved from the field-name definition, and are used to validate the from-data and to-data formats. 
  • position
    Specifies the starting field positioning the record. Valid values are the following:
    • 1 - 32760
      The actual position number.
    • +nnn
      or
      - nnn
      The relative position to the current location of the record. 
  • scan-length
    Specifies the amount of data to compare. If you specify 0, scanning starts at the
    position
    value to the record length. Valid values are 0 - 32760. No scanning is done if the
    scan-length
    is omitted.
  • operator
    Specify one of the following values:
    • CO
      Contains -- If a
      field-name
      is supplied, the
      position
      and
      scan-length
      values are retrieved from the defined starting position and physical length of the 
      field-name
       . If
      position
      and
      scan-length
      are supplied, the record is scanned for the
      data
      beginning at
      position
      for a length of
      scan-length
      .
    • EQ
      Equal
    • NE
      Not equal
    • GT
      Greater than
    • GE
      Greater than or equal to
    • LE
      Less than or equal to
    • LT
      Less than
  • data:
    • C'c…'
      Character -- matches the specified case
    • N'n…'
      Numeric -- Processes the literal as defined by the
      field-name
      parameter. The field-name parameter must be defined as a numeric field, and it is only valid when a field-name parameter is supplied.
    • P'n…'
      Packed
    • T'x…'
      Text -- matches both lowercase and uppercase alphabetic characters. Alphanumeric characters are permitted.
    • X'hh…'
      Hexadecimal
  • data - type:
    • EQP
      Valid packed decimal data
    • NEP
      Not valid packed decimal data
    • EQN
      Valid numeric data
    • NEN
      Not valid numeric data
Keywords
The following is a complete list of the valid keywords that you can use with the IF, AND, OR keywords.
  • ACCUM
  • CHANGE
  • EDIT
  • IF, AND, OR
  • INLIM
  • MOVE
  • OUTFILE
  • PADCHAR
  • POSITION
  • PRINTREC
  • REPLACE
  • SELECT
  • SELLIM
  • SKIP
  • STOP
  • WRITE
The following list shows examples of conditional processing:
  • IF(1,GT,C'123')
    Position 1 > '123'
  • IF(1,EQ,C'12',C'234',C'5')
    Position 1 = '12' or '234' or '5'
  • IF(1,NE,C'A',C'B')
    Position 1 not = either literal
  • IF(1,1,NE,C'A',C'B')
    Position 1 not = either literal
  • IF(1,5,NE,C'A',C'B')
    Neither literal found in scan of position1 - 5
  • IF(1,EQ,C'ABCD',T'Efg')
    Comparison against mixed format of character string
  • IF(1,20,EQ,C'ABC')
    Scan for 'ABC' starting in position 1 for a length of 20
  • IF(1,20,GT,C'123')
    Scan for any 3-byte character string > '123' in position 1-20
  • IF(1,0,EQ,C'ABC')
    Scan for 'ABC' starting in position 1 to end of record
  • IF(1,EQ,C'A')
    Position 1 = 'A'
  • IF(1,EQ,T'ABC,DEFG,HIJKL')
    Literals within single quotes that are compared to position 1
  • IF(1,50,EQ,C"2,000,000.00")
    Literal containing ',' within double quotes
  • IF(1,EQ,C'AA,BB,CC')
    Position 1= 'AA' or 'BB' or 'CC'
  • IF(1,50,EQ,C'ABC',P'00001',T'Abc')
    Scan for any of these character strings in position 1 for a length of 50
  • IF(21,0,EQ,C'ABC',P'00001',T'Def')
    Scan for any of these character strings in position 21 to the end of the record
  • IF(1,0,EQ,P'0001')
    Packed field of any length with value of 1 starting in position 1
  • IF(1,3,GT,P'00001')
    Compare of position 1 for a length of 3 to packed 3-byte literal
  • IF(1,5,EQ,P'00001')
    Scan of position 1 for a length of 5 for packed 3-byte literal
  • IF(1,5,LT,C' ')
    Compare position 1 for a length of 5 to < blanks
  • IF(1,5,LT,3C' ')
    Scan position 1 for a length of five for three positions < blanks
  • IF(20,0,EQP)
    Packed field of any length starting in position 20
  • IF(20,3,EQP)
    Packed field of length 3 at position 20
  • IF(20,4,NEP)
    Position 20 for a length of 4 is not a valid packed field
  • IF(20,0,NEP)
    The field starting at position 20 is not a valid packed field
  • IF(20,0,5NEP)
    Not true that there are 5 contiguous packed fields of any length starting in position 20
  • IF(20,3,10EQP)
    Ten 3-byte packed fields starting in position 20
  • IF(20,3,10EQP)
    Not true that there are ten 3-byte packed fields starting in position 20
  • IF(20,0,EQP)
    Packed field of any length starting in position 20
  • IF(10,5,EQN)
    10 (5) is valid numeric
  • IF(10,5,3EQN)
    Three consecutive 5-byte numeric fields starting in position 10
Example 1
These examples show two implied OR formats, by changing the data parameter. The first example means that only the records where the STATE-CODE either contains the character string CT or MA are printed.
READ,
  LAYOUTFILE(LAYOUT),
  IF(STATE-CODE,EQ,C'CT,MA'),
    PRINTREC
The second example means that only the records where the STATE-CODE either contains the character string "CT", "Ct", "cT", "ct" or "MA" are printed.
READ,
  LAYOUTFILE(LAYOUT),
  IF(STATE-CODE,EQ,T'CT,C'MA'),
    PRINTREC
Example 2
Only records that contain characters from 00 through 10 are printed to SYSLIST. All records are copied to SYSUT1O.
COPY,
  IF(5,GE,C'00'),
    OR(5,LE,C'10'),
      PRINTREC  
Example 3
Typically single quotes are used to enclose character strings. However, if the character string contains a comma, double quotes are required. This example looks for the character string ABC,DEF,GHI beginning on position 5, and prints them to SYSLIST, if found.
COPY,
  IF(5,EQ,C"ABC,DEF,GHI"),
    PRINTREC
Example 4
If STATE-CODE contains AZ, the entire record is written to AZFILE. If those same positions have the characters IL, the entire record is written to the ILFILE. The WRITE(AZFILE) terminates the first IFs subordinate actions.
READ,
  LAYOUTFILE(LAYOUT),
  MOVE(CLEAR),
  MOVE(1,0,1),
  IF(STATE-CODE,EQ,C'AZ'),
    WRITE(AZFILE),  
  IF(STATE-CODE,EQ,C'IL'),
    WRITE(ILFILE)   
INFILE
Use the INFILE keyword to specify the input sequential, VSAM, or PDS data set. INFILE is not valid with the COMPARE command. Use the keyword OLDFILE with the COMPARE command.
The keyword can be specified once per command. The shipped default value of SYSUT1 may have been changed during installation.
Syntax
INFILE({[SYSUT1 | 
dsname
[(member)] | 
ddname
] [,CLOSE | ,NOCLOSE] [,ENHANCED | ,STANDARD]})
Parameters
INFILE supports the following parameters:
  • dsname
    Identifies the data set name and optional member that contains the input records. This data set is dynamically allocated. A JCL is not required to reference this dsname.
  • ddname
    The input file ddname. One to seven characters if OUTFILE is not provided. Otherwise, the length can be the standard eight characters.
  • CLOSE
    This parameter value closes the INFILE after the command has completed processing. This is the default value, but it may have been changed by updating the &BAT_CLOSEIN installation option.
  • NOCLOSE
    This parameter value does not close the INFILE after the command has completed processing. However, all data sets are closed before executing subsequent job steps.
    When the NOCLOSE parameter is used, the current job step subsequent command begins processing with the next record from the INFILE.
  • ENHANCED
    Each file in the concatenation is processed by the command individually. Enhanced concatenation supports the following:
    • Concatenating sequential files with VSAM files, or PDSs with other PDS file, but not sequential or VSAM files with PDSs.
    • Concatenating files with different attributes; for example, concatenating files containing fixed-length records with files containing variable length records, or concatenating files with different record lengths.
  • STANDARD
    The files in the concatenation are processed as a single file. This parameter supports any valid concatenation that is supported by the operating system.
Note:
If a ddname is chosen for the INFILE value and there is no OUTFILE keyword, the output file ddname is the INFILE ddname with the character O appended to it. See example 1.Both dsname(member) and ddname are optional. If both are omitted, either the CLOSE or NOCLOSE option must be supplied.
Example
This example syntax specifies CUSTREC as the ddname of the primary input file, and does not close CUSTREC before starting the execution of the PRINT command. PRINT begins processing with CUSTREC's 501st record. The output file ddname is CUSTRECO.
COPY,
  INFILE(CUSTREC,NOCLOSE),
  INLIM(500),
PRINT
INFORMAT
Use the INFORMAT keyword to maintain JCL formatting when changing JCL.The application defines a JCL statement to be a single record with a '//' in positions 1 and 2. Each JCL statement is evaluated and operated on individually. If a change increases the length of the JCL statement past position 71, it is broken and continued on the next line. Other records are operated on according to standard keyword behavior without INFORMAT (JCL) rules. JCL comment cards, statements that begin with "//*" in the positions 1 through 3, are not processed by the INFORMAT parameter.
Use the IF keyword with INFORMAT to instruct the application to evaluate and operate on a complete JCL statement instead of a single JCL statement. A complete JCL statement is a group of successive JCL statements that continue until one is encountered that does not end in a comma. With IF you can query for a value on one JCL statement and can make a change on any other JCL statement within the same complete JCL statement.
We do not recommend using SELRECIF with INFORMAT(JCL) as this processes only the individual JCL statements that meet its selection criteria, and no others.
Note:
INFORMAT(JCL) is not supported with the UPDATE command. When updating a JCL member or members, use the COPY command and specify the same data set name on the input and output PDS. The following example shows the COPY syntax.
COPY INFILE(MBRIN),
     OUTFILE(MBROUT),
     INFORMAT(JCL),
       CHANGE(1,0,EQ,C'DSN=XXXXXXXX',C'DSN=YYYYYYYY')
Syntax
INFORMAT(JCL)
Parameters
INFORMAT only requires the character string 'JCL'.
Example 1
This is an example of how JCL statements are broken and continued on a new line when the change causes the statement to go beyond column 71. When DSN=CUSTOMER is changed to DSN=CUSTOMER.UPDATE, the UNIT=SYSDA parameter is continued on the next line.
COPY,
  INFORMAT(JCL),
  CHANGE(1,0,EQ,C'DSN=CUSTOMER.',C'DSN=CUSTOMER.UPDATE.MSTR.')
from
//DATAOUT  DD  DSN=CUSTOMER.FILE,DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
//             SPACE=(CYL,(1,1)),                                   
//             DCB=(RECFM=VB,LRECL=110,BLKSIZE=11400)
to
//DATAOUT  DD  DSN=CUSTOMER.UPDATE.MSTR.FILE,DISP=(NEW,CATLG,DELETE), 
//             UNIT=SYSDA,                                       
//             SPACE=(CYL,(1,1)),                                
//             DCB=(RECFM=VB,LRECL=110,BLKSIZE=11400)
Example 2
This is an example of how the IF statement lets you evaluate a complete JCL statement. In this example, when a field on the first JCL statement is evaluated to a true condition, data is changed on a subsequent JCL statement within the complete JCL statement. When DSN=CUSTOMER.FILE is found, the CHANGE command is applied to UNIT=SYSDA parameter on the 2nd JCL statement and UNIT=SYSDA is changed to UNIT=VIO.
COPY,
  INFORMAT(JCL),
  IF(1,0,EQ,C'DSN=CUSTOMER.FILE'),  
    CHANGE(1,0,EQ,C'UNIT=SYSDA',C'UNIT=VIO')
from
//DATAOUT  DD  DSN=CUSTOMER.FILE,DISP=(,DELETE),  
//             UNIT=SYSDA,                                 
//             SPACE=(CYL,(1,1)),                          
//             DCB=(RECFM=VB,LRECL=110,BLKSIZE=11400)      
to
//DATAOUT  DD  DSN=CUSTOMER.FILE,DISP=(,DELETE),        
//             UNIT=VIO,                                         
//             SPACE=(CYL,(1,1)),                                
//             DCB=(RECFM=VB,LRECL=110,BLKSIZE=11400)            
INLIM
The INLIM keyword sets the maximum number of records that are read from the primary input file, usually SYSUT1. INLIM is not reinitialized to 0 with each PDS member that it processes. Once the INLIM is reached, the record is processed and the command is terminated. Use INLIM only once per command.
Syntax
INLIM(0 | 
number
)
Parameters
INLIM supports the following parameter:
  • number
    Any integer value from 0 through 999,999,999. The default value, 0, sets no limit on how many records are read before terminating the command.
Example
This example syntax terminates the COPY command after it processes the 99th record. Out of the first 99 records, only the records whose RECORD-TYPE fields contain a C'Z' is copied. PRINT processing begins with the 100th record of SYSUT1.
COPY,
  INLIM(99),
  LAYOUTFILE(LAYOUT),
  INFILE(,NOCLOSE),
  SELRECIF(RECORD-TYPE,EQ,C'Z')
PRINT
INSERTED
The INSERTED keyword specifies to which output file the inserted records of the new file are written. It is only valid with the COMPARE command and can only be used once per command.
With COMPARE PROGRAM, the file must have a variable blocked record format with a maximum record length of at least 2048 bytes.
Syntax
INSERTED(
ddname
)
Parameters
INSERTED supports the following parameters:
  • ddname
    The one to eight-character ddname of the sequential file to which INSERTED records are written.
Example
This example syntax writes the new file records that do not exist in the old file to the sequential file referenced by ddname INSTRECS.
COMPARE
  LAYOUTFILE(LAYOUT),
  SYNCKEY(RECORD-KEY),
     INSERTED(INSTRECS)
INTERVAL
The INTERVAL keyword is used to select a specified number of records at regular intervals. The two positional parameters specify the number of records to select and to skip in each interval. Records are first selected before any records are skipped. It is not subordinate to any SEL* or IF keywords.
Syntax
INTERVAL(
number_to_select
,
number_to_skip
)
Parameters
INTERVAL supports the following two parameters:
  • number_to_select
    Any integer value from 1 through 999,999,999. Specifies the number of records to select before any records are skipped.
  • number_to_skip
    Any integer value from 1 through 999,999,999. Specifies the number of records to skip between each interval of selected records.
Example 1
This example selects the first two records for printing and skips the next three records. It continues with this interval selection until the EOF.
PRINT ,
  FORMAT(LIST)
  INTERVAL(2,3),
You would expect output similar to this:
Print Report                 DSN = USER010.CAWABAT2.JOB04334.D0000101.?   Rec Length = 80
                                                                                
111111  APPLE                                                           
222222  APPLE                                                           
666666  APPLE                                                           
777777  ORANGE                                                          
BBBBBB  APPLE                                                           
CCCCCC  APPLE                                                           
*** CAWA2101I  DDNAME SYSUT1   records read:    15, selected 6                  
                                                                                
*** CAWA2550I  PRINT completed   RC = 0   High RC = 0 
CAWA2001I SYSLIST output was directed to SYSPRINT
                                                 
CAWA2000I Utility ending, Max CC=0                                         
LAYOUTFILE
The LAYOUTFILE keyword points to the copybook used during processing. Copybooks must be defined before referencing them with this keyword. The default value for this keyword is the ddname LAYOUT.
Syntax
LAYOUTFILE({LAYOUT|
dsname
(
member
)|
ddname}
)
Parameters
LAYOUTFILE supports the following parameters:
  • dsname(member)
    Identifies the data set name and required member that contains the copybook. This data set is dynamically allocated. A JCL is not required to reference this dsname.
  • ddname
    Functions like the dsname except the ddname refer to the job step JCL ddname that contains the data set name and member.
Example 1
The copybook that is used during the execution of the PRINT command is in CUSTOMER.COPYLIB(CPYBOOK). The file data is overlaid with the copybook found in the member CPYBOOK.
PRINT,
  LAYOUTFILE(CUSTOMER.COPYLIB(CPYBOOK)),
  FORMAT(SINGLE) 
Print Report                 DSN = CUSTOMER.FILE  
                                                                                
Rec #1                                                                          
Pos   *-----------FIELD NAME--------------* FORMAT  *---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
    1 01 COMPANY-DATA                            80                             
    1   03 COMPANY-NAME                     C    20 Intl Widget                 
   21   03 COMPANY-ADDRESS                  C    30 534 Commerce Way            
   51   03 COMPANY-CITY                     C    10 Denver                      
   61   03 COMPANY-STATE-CODE               C     2 CO                          
   63   03 FILLER                           C    18                                                 
Example 2
The copybook that is used during the execution of the COPY command is referenced by the ddname of DDLAYOUT. All records whose FIELD-A value is 55 are copied to the output file. Ensure that you provide a layout member because the SELRECIF keyword references a field name. This layout must map the input file data. If LAYOUTFILE is omitted, the default ddname LAYOUT is used.
COPY,
  LAYOUTFILE(DDLAYOUT),
  SELRECIF(FIELD-A,EQ,N'55')
LAYOUTFILEN
The LAYOUTFILEN keyword points to the COBOL or PL/I copybook used to resolve field names on the NEW file during COMPARE processing. Copybooks must already be defined before referencing them with this keyword. The default value for this keyword is the ddname LAYOUTN. You can use this keyword once per command. If LAYOUTFILEN is not present and no LAYOUTN DD statement is coded in the JCL, the old file layout is used.
Syntax
LAYOUTFILEN({LAYOUTN|
dsname
(
member
)|
ddname}
)
Parameters
LAYOUTFILEN supports the following parameters:
  • dsname(member)
    Identifies the data set name and required member that contains the copybook. This data set is dynamically allocated. A JCL is not required to reference this dsname.
  • ddname
    Functions like the dsname except the ddname refer to the job step JCL ddname that contains the data set name and member.
Example
The copybook that is used for the OLD file during the execution of the COMPARE command is in CUSTOMER.COPYLIB(CPYBOOK). The copybook that is used for the NEW file during the execution of the COMPARE command is in CUSTOMER.NEW.COPYLIB(CPYBOOK). OLD_KEY_FIELD and OLD_FIELD_NAME are resolved by looking in the LAYOUTFILE copybook, and NEW_KEY_FIELD and NEW_FIELD_NAME are resolved by looking in the LAYOUTFILEN copybook. The compare report uses both copybooks to map the data.
COMPARE,
  LAYOUTFILE(CUSTOMER.COPYLIB(CPYBOOK)),
  LAYOUTFILEN(CUSTOMER.NEW.COPYLIB(CPYBOOK)),
  FORMAT(SINGLE),
  SYNCKEY(OLD_KEY_FIELD,NEW_KEY_FIELD),
  POSITION(OLD_FIELD_NAME,NEW_FIELD_NAME)
LAYOUTRC
Use the LAYOUTRC keyword to set the step return code if the dsname in the LAYOUTFILE keyword is uncataloged. The default value is 4, but this may have been changed during the installation.
Syntax
LAYOUTRC(4 | 
return-code
)
Parameters
LAYOUTRC supports the following parameter:
  • return-code
    An integer value from 0 through 4095
LINEPAGE
Use the LINEPAGE keyword to set the maximum number of lines per page for SYSLIST. The default value is 60, but this may have been changed during the installation. A large number prevents page breaks from occurring.
Syntax
LINEPAGE(60 | 
number
)
Parameters
LINEPAGE supports the following parameter:
  • number
    An integer value from 1 through 9999
LOAD
Use the LOAD keyword to specify a load module report for the LOADINFO command. This keyword is only valid with the LOADINFO command and can only be used once per command. This keyword produces a load module report listing all attributes of the the load module and all their CSECTs.
Syntax
LOAD
Example
This example creates a load module report for all load modules in the load library that is referenced by the ddname LOADLIB.
LOADINFO,
     LOAD
LOADEXCLUDE
Use the LOADEXCLUDE keyword to specify which load modules should be excluded from the LOADINFO report. This keyword is only valid with the LOADINFO command and can only be used once per command. This keyword cannot be used with the LOADINCLUDE keyword.
Syntax
LOADEXCLUDE({membe
r
 | 
pattern
 | startmember-endmember}[,…])
Parameters
LOADEXCLUDE supports the following parameters:
  • member
    Specifies a load module name to exclude from processing.
  • pattern
    Specifies a pattern. Load module names that match this pattern are excluded from processing.
    * - An asterisk signifies any number of characters starting in this position.
    % - A percent sign is a placeholder for a character in the specific position.
  • startmember
    Specifies the starting load module name when identifying a range of load modules to exclude from processing. Specify asterisk (*) to exclude all load modules less than the endmember. Startmember can be any valid pattern name.
  • endmember
    Specifies the ending load module name when identifying a range of load modules to exclude from processing. Specify asterisk (*) to exclude all load modules greater than the startmember. Endmember can be any valid pattern name.
Example
This example creates a load module report for all load modules in a load library, except any load module names starting with PAY.
LOADINFO,
  LOADEXCLUDE(PAY*), 
  LOAD
LOADINCLUDE
The LOADINCLUDE keyword specifies which load modules to include in the LOADINFO report. This keyword is only valid with the LOADINFO command and can only be used once per command. This keyword cannot be used with the LOADEXCLUDE keyword.
Syntax
LOADINCLUDE({member | 
pattern
 | startmember-endmember}[,…])
Parameters
LOADINCLUDE supports the following parameters:
  • member
    Specifies a load module name to select for processing.
  • pattern
    Specifies a pattern. Load module names that match this pattern are selected for processing.
    * - An asterisk signifies any number of characters starting in this position.
    % - A percent sign is a placeholder for a character in the specific position.
  • startmember
    Specifies the starting load module name when identifying a range of load modules to select for processing. Specify asterisk (*) to select all load modules less than the endmember. Startmember can be any valid pattern name.
  • endmember
    Specifies the ending load module name when identifying a range of load modules to select for processing. Specify asterisk (*) to select all load modules greater than the startmember. Endmember can be any valid pattern name.
Example
This example creates a load module report that lists the DATERTN and TIMERTN load modules in addition to all load modules starting with CUST.
LOADINFO,  
  LOADINCLUDE(DATERTN,TIMERTN,CUST*), 
LOADLIB
The LOADLIB keyword points to a module load library used during processing of the LOADINFO command. The default value is the ddname LOADLIB.
Syntax
LOADLIB({LOADLIB | 
dsname
 | 
ddname
})
Parameters
LOADLIB supports the following parameters:
  • dsname
    Identifies the data set name of the module load library. This data set is dynamically allocated. A JCL is not required to reference this dsname.
  • ddname
    Functions like the dsname except the ddname refer to the job step JCL ddname that contains the data set name of the load library.
LOGFILE
The LOGFILE keyword points to the sequential data set that contains the change log records captured during a CA File Master Plus EDIT session, which is used by the PRINTLOG command. The default value is the ddname LOGFILE.
Syntax
LOGFILE({LOGFILE|
dsname
 | 
ddname
})
Parameters
LOGFILE supports the following parameters:
  • dsname
    Identifies the data set name of the change log file. This data set is dynamically allocated. A JCL is not required to reference this dsname.
  • ddname
    Functions like the dsname except the ddname refer to the job step JCL ddname that contains the data set name of the editor change log file.
Example
This example prints the editor change log records in single record format for all changed, inserted, or deleted records recorded during the change log file referenced by the MYLOG ddname. LAYOUTFILE needs to reference the layout member that was used during the edit session.
PRINTLOG,
  LOGFILE(MYLOG),
  LAYOUTFILE(LAYOUT),
  FORMAT(SINGLE)
MAP
The MAP keyword controls the printing of an extent map of the VOLSER or UNIT parameter values, following the VOLINFO report. The MAP keyword is valid only with the VOLINFO command, and you must specify the UNIT and VOLSER keywords. When MAP is omitted, the extent map report is not generated. Only one MAP keyword is allowed per VOLINFO command.
Syntax
MAP({EXTENTS | FREESPACE})
Parameters
MAP supports the following parameters:
  • EXTENTS
    Generates a report documenting the complete extent map of the volume.
  • FREESPACE
    Generates a report documenting a map of the free extents on the volume.
Example 1
This example generates an extent listing for the VOLSER PAK001:
VOLINFO,
  VOLSER(PAK001),
  MAP(EXTENTS)
Extents listing for VOLSER: PAK001
Volume cccccc-hh Data Set Name                                 Org    Tracks     Extents
------ --------- --------------------------------------------  ----   ------    ----------
PAK001 000000-00 ...Volume Label and VTOC pointer...                       1
PAK001 000000-01 SYS1.VVDS.VOSI001                             VSAM       10      1 of   2
PAK001 000000-11 ICF.OSI.USERCAT.CATINDEX                      VSAM        1      1 of   1
PAK001 000000-12 AD1QA.FMMVS41.VJEBF01.IVPSFL.TEST01           PS          1      1 of   1
PAK001 000000-13 AD1QA.FMMVS41.RI00168.TEST.VB137              PS          1      1 of   1
PAK001 000000-14 ...Free Space...                                          1
PAK001 000001-00 AD1QA.FMMVS41.TEST.PDS                        PDS         5      1 of  10
PAK001 000001-05 AD1QA.FMMVS80.TEST.PDS                        PDS         5      2 of  10
Example 2
This example generates a free space listing for the VOLSER PAK001:
VOLINFO,
  VOLSER(PAK001),
  MAP(FREESPACE)
Free Space listing for VOLSER: PAK001
Volume cccccc-hh Data Set Name                                 Org    Tracks     Extents
------ --------- --------------------------------------------  ----   ------    ----------
PAK001 000000-14 ...Free Space...                                          1
PK0001 000026-09 ...Free Space...                                          1
PK0001 000031-00 ...Free Space...                                          5
PK0001 000051-10 ...Free Space...                                          2
PK0001 000056-13 ...Free Space...                                          2
PK0001 000065-07 ...Free Space...                                          3
PK0001 000080-11 ...Free Space...                                          2
PK0001 000093-14 ...Free Space...                                          5
PK0001 000100-10 ...Free Space...                                          5
PK0001 000121-12 ...Free Space...                                          5
PK0001 000133-05 ...Free Space...                                          5
PK0001 000133-12 ...Free Space...                                          3
MATCHED
The MATCHED keyword specifies the output file to which the matched records are written. It is only valid with the COMPARE command and can be used twice per command.
With COMPARE PROGRAM, the file must have a variable blocked record format with a maximum record length of at least 2048 bytes.
Because a COMPARE can be done for only a portion of the record by using the POSITION keyword, it is possible that records that are considered matched in the COMPARE are different somewhere else on the record. In this case, the old and new record can be written to separate files using the OLD and NEW parameters. Both records are written to the file if ALL is specified.
Syntax
MATCHED(ddname[,ALL|,NEW|,OLD])
Parameters
MATCHED supports the following parameters:
  • ddname
    The one to eight-character ddname of the sequential file in which all of the MATCHED records are written.
  • ALL
    Specifies that all matched records in the old and new files are written to the ddname.
  • NEW
    (Default) Specifies that only matched records from the new file are written to the ddname.
  • OLD
    Specifies that only matched records from the old file are written to the ddname.
Example
This example syntax writes matched records from the new file to the sequential file referenced by ddname MTCHRECS.
COMPARE
MATCHED(MTCHRECS)
MEMBER
Use the member keyword to select the PDS members that you want processed. You can specify a single member name, a pattern, or a range of members. If SELMEMIF is also present, MEMBER and SELMEMIF are ANDed together. A member is selected if it meets the selection criteria for both keywords.
Syntax
MEMBER({
member
 | 
pattern
 | 
startmember-endmember
}[,…])
Parameters
MEMBER supports the following parameters:
  • member
    Specifies the PDS member name selected for processing.
  • pattern
    Specifies a pattern. PDS member names that match this pattern are selected for processing.
    * - An asterisk signifies any number of characters starting in this position.
    % - A percent sign is a placeholder for a character in the specific position.
  • startmember
    Specifies the starting PDS member name when identifying a range of members to select for processing. Specify asterisk (*) to select all members from the beginning of the PDS. Startmember can be any valid pattern name.
  • endmember
    Specifies the ending PDS member name when identifying a range of members to select for processing. Specify asterisk (*) to select all members to the end of the PDS. Endmember can be any valid pattern name.
Example
This syntax example only copies the member IEBCOMPR, any member that begins with ZAP, and all members beginning with an A or B
COPY,
  MEMBER(IEBCOMPR,ZAP*,A*-B*)
MOVE
The MOVE keyword moves data from the work buffer to the move buffer.
The move buffer is created and initialized with the first MOVE keyword encountered. It is initialized with the PADCHAR value, if a PADCHAR value is supplied. If a PADCHAR value is not specified, the move buffer is initialized with low values. You use multiple MOVE statements to populate the move buffer. The rightmost position moved to determine the length of the move buffer.
If the move buffer is greater than the output maximum allowable record length, the move buffer is truncated to that value and the TRUNCRC value is returned.
If the move buffer is less than the output maximum allowable record length, the following statements apply:
For variable record lengths, the move buffer length determines the length of the output record.
For fixed record lengths, the move buffer is padded with the current PADCHAR value to the defined record length.
The WRITE keyword must be used to write the move buffer to the output files. Use the CLEAR parameter value to reset all bytes in the current move buffer to the current PADCHAR value, and for variable output files, to reset the move buffer length to 0. The move buffer length is also set to 0 for variable output files with each input record read.
Syntax
MOVE({to-position,{to-data | length,from-position|from-field-name} | CLEAR})
MOVE(to-field-name{,to-data|,from-field-name})
MOVE(to-position,0,to-data)
Parameters
MOVE supports the following parameters:
  • to-field-name
    Use
    to
    -
    field-name
    when referencing a data field that is defined in the record layout. The layout must be available to the job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE.
    Note:
    When this parameter is supplied, the keyword position is retrieved from the
    to
    -
    field-name
    definition, and is used to validate the
    to-data
    format.
  • to-position
    Specifies the position to store data. Valid choices are as follows:
    • 1 - 32760
      The actual position number
    • +nnn or - nnn
      The relative position to the current location of the record.
  • to-data
    Specify one of the following:
    • C'c…
      '
      Character -- matches specified case
    • N'n…
      '
      Numeric -- processes the literal as defined by the
      field-name
      parameter. The
      field-name
      parameter must be defined as a numeric field, and it is only valid when a
      field-name
      parameter is supplied.
    • P'n…
      '
      Packed
    • T'c…
      '
      Text -- uppercase letters are substituted for their lowercase counterparts. Alphanumeric data is permitted.
    • X'hh…
      '
      Hexadecimal
  • length
    Specifies the amount of data to move. A value of 0 indicates that the data to move begins at the
    from-position
    and goes to the
    length
    of the input record. Valid values are 0 - 32760.
  • from-field-name
    Use
    from-field-name
    when referencing a data field that is defined in the record layout. The record layout must be available to the job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE.
    Note:
    When this parameter is supplied, the keyword 
    from-position
    and
    length
    are both retrieved from the f
    rom-field-name
    definition. 
  • from-position
    Starting position in the record. This value cannot reference data that is greater than the record length. Valid choices are as follows:
    • 1 - 32760
      The actual position number
    • +nnn or - nnn
      The relative position to the record current location
  • CLEAR
    This parameter value initializes the move buffer to the current PADCHAR value and resets the move buffer length for variable output records to 0.
    • 0
      Repeat the data literal, starting at the
      to-position
      , for the length of the output record. For variable record output files, this length is the input record length.
Example 1
This example syntax moves the character string 'CT' to position 5 of the output buffer, and writes the output buffer.
READ,
  MOVE(CLEAR),
  MOVE(5,C'CT'),
  WRITE(CTFILE)
To obtain the same results, use the to-field-name parameter with the LAYOUTFILE keyword, which would reference the layout member that maps the input file data.
READ,
  LAYOUTFILE(LAYOUT),
  MOVE(CLEAR),
  MOVE(STATE-CODE,C'CT'),
  WRITE(CTFILE)
Example 2
Input record positions 1-10 are moved to output record positions 1-10. Input record positions 21 - 30 are moved to output record positions 11-20, and input record positions 11-20 are moved to output record position 21-30. The WRITE command resets the relational position back to 1.
READ,
  MOVE(CLEAR),
  MOVE(+0,10,1),
  MOVE(+0,10,21),
  MOVE(+0,10,11),
  WRITE(OUTPUT)
Example 3
This next example moves the entire record to the move buffer. It examines the STATE-CODE field. If it is equal to KS, it appends 6.0 to the end of the record, whatever that position is. If it finds MO, it appends 6.5 to the end of the record. Once the characters are appended, the records are written to the appropriate file and processing continues with the next record.
READ,
  LAYOUTFILE(LAYOUT),
  MOVE(CLEAR),
  MOVE(1,0,1),  
  IF(STATE-CODE,EQ,C'KS'),
    MOVE(+0,C'6.0'),    
    WRITE(KSFILE),  
    NEXTREC,    
  IF(STATE-CODE,EQ,C'MO'),
    MOVE(+0,C'6.5'),    
    WRITE(MOFILE)   
Example 4
The following example shows how you can easily move one field to another field's location in the output file NEWFILE. The length of the MOVE is decided on by the physical length of the defined physical length of the from-field-name, in this case the CC-ADDRESS and CC-NAME fields. Both fields must be defined in the same layout file.
READ,
  LAYOUTFILE(LAYOUT),
  MOVE(CLEAR),
  MOVE(SHIPPING-ADDRESS,CC-ADDRESS),
  MOVE(SHIPPING-NAME,CC-NAME),
  WRITE(NEWFILE)
NEWFILE
The NEWFILE keyword points to the file that is compared against a baseline, or old file. This keyword is allowed once per command, can only reference a VSAM or a sequential file or a member of a PDS, and is only valid with the COMPARE command. The default value is SYSUT1N, but this value may have been changed during installation.
Syntax
NEWFILE({SYSUT1N | 
dsname
[(
member
)] | 
ddname
})
Parameters
NEWFILE supports the following parameters:
  • dsname
    Identifies the data set name and optional member name of the new file, which is dynamically allocated. A JCL is not required to reference this dsname.
  • ddname
    Specifies the 1 - 8 character ddname of the new file.
Example
This example syntax reads file ddname NEWMSTR as the file in which to compare.
COMPARE,
  NEWFILE(NEWMSTR)
NEWMEMBER
The NEWMEMBER keyword is used to rename a PDS member while using the COPY command. NEWMEMBER only accepts a single name. This keyword can only be used once per command.
Note:
It is possible to generate identical names. Replacing identically named members can be controlled using the REPLACEMEM keyword.
Syntax
NEWMEMBER(
member
pattern
)
Parameters
NEWMEMBER supports the following parameters:
  • member
    Specifies the name of the new PDS member.
  • pattern
    Specifies a pattern. Member names that match this pattern are used when copying more than one PDS member. You can use a percent sign to retain in the new member name the character found at the percent sign location in the old name.
Example 1
This example overwrites CAWA with RRMX, for all member names that begin with CAWA.
COPY,
  MEMBER(CAWA*),
  NEWMEMBER(RRMX%%%%)
Example 2
This example appends RRM to all member names beginning with A and which have only five characters in their name.
COPY,
  MEMBER(A%%%%),
  NEWMEMBER(%%%%%RRM)
NEWRID
The NEWRID keyword positions the data set specified by the NEWFILE keyword to a specific record before starting processing. If this keyword is not supplied, record processing begins with the first record. NEWRID is only valid with the COMPARE command, and can only be used once per COMPARE. This keyword is mutually exclusive with the RID keyword.
For KSDS processing, if the record key does not exist, processing begins with the next record that is greater than the
rid
value. If NEWFILE is not supplied, the default file SYSUT1N is positioned accordingly.
Syntax
NEWRID(
rid
)
Parameters
Valid
rid
values for each supported file format are as follows:
  • ESDS
    Specifies a relative byte address (RBA) in a four-byte hexadecimal format:
    • X'hh…
      '
      Hexadecimal
  • KSDS
    Specifies the record key in one of the following formats:
    • C'c…
      '
      Character -- matches specified case
    • X'hh…
      '
      Hexadecimal
  • RRDS
    Specifies the relative record number (RRN)
  • Sequential
    Specifies the actual record number, valid values are 1 - 999,999,999
Note:
When using a hexadecimal value, you must supply an even number of hexadecimal characters.
Example 1
This example syntax is for a KSDS file. Record processing begins with the record that has the key value X'1000', or if that key does not exist, the next higher key. If there is no NEWFILE keyword, the default value SYSUT1N is positioned accordingly.
COMPARE,
  NEWRID(X'1000')
Example 2
This example syntax is for RRDS and sequential files. Processing begins with the 32nd record of the data set specified by the NEWFILE keyword, or if NEWFILE is not supplied, the data set specified by the default value SYSUT1N is positioned accordingly.
COMPARE,
  NEWRID(32)
NEXTREC
The NEXTREC keyword causes current record processing to halt and the next record to be read. Any keywords after the NEXTREC command are not executed before reading the next record. This keyword is only valid as a subordinate keyword to SELMEMIF, SELRECIF, AND and OR.
Syntax
NEXTREC
Parameters
NEXTREC supports no parameters
Example
This example syntax writes records with a STATE-CODE value of C'KS' to ddname KSOUT, of C'OK' to OKOUT, of 'TX' to TXOUT and all other STATE-CODE values to 'OTHEROUT'.
READ,
  LAYOUTFILE(LAYOUT), 
  MOVE(CLEAR),
  MOVE(1,0,1),
  IF(STATE-CODE,EQ,C'KS'),
    WRITE(KSOUT),
    NEXTREC,
  IF(STATE-CODE,EQ,C'OK'),
    WRITE(OKOUT),
    NEXTREC,
  IF(STATE-CODE,EQ,C'TX'),
    WRITE(TXOUT),
    NEXTREC,
  IF(STATE-CODE,NE.C'TX'),
    WRITE(OTHEROUT)
NOSELRC
The NOSELRC keyword sets the command return code if no selection criteria are matched. The default value is 4, but this may have been changed during installation.
Syntax
NOSELRC(4 | 
return-code
)
Parameters
NOSELRC supports the following parameter:
  • return-code
    Specifies an integer value from 0 through 4095.
OCCURS
The OCCURS keyword specifies which XML type is generated when you process the GENXML command. This keyword is only valid with GENXML commands. It can only be used once per command.
Syntax
OCCURS({
BYATTRIBUTE
 | 
BYNAME
})
Parameters
OCCURS supports the following parameters:
  • BYATTRIBUTE
    Generates the XML file based on field attributes.
  • BYNAME
    Generates the XML file based on field names.
If you run a GENXML command and do not specify OCCURS, then an XML file based on field attributes is generated.
OLDFILE
The OLDFILE keyword points to the baseline file when using the COMPARE command. This keyword is allowed only once per command and can reference a VSAM file, a sequential file, a PDS, or a PDS member, and it is only valid with the COMPARE command. The default value for OLDFILE is SYSUT1, but this may have been changed during installation.
Syntax
OLDFILE({SYSUT1 | 
dsname
[(
member
)] | 
ddname
})
Parameters
OLDFILE supports the following parameters:
  • dsname
    Identifies the data set name of the baseline file and optional member name for a COMPARE command. This data set is dynamically allocated. A JCL is not required to reference this dsname. If the data set is a PDS, the member name is required.
  • ddname
    Specifies the one- to eight-character ddname of the original file to be compared. SYSUT1 is the default.
Example:
In this example syntax the ddname OLDMSTR references the original or baseline file that is to be compared.
COMPARE,
OLDFILE(OLDMSTR)
OLDRID
The OLDRID keyword positions the data set specified by the OLDFILE keyword to a specific record before starting processing. If this keyword is not supplied, record processing begins with the first record. OLDRID is only valid with the COMPARE command and can only be used once per COMPARE. This keyword is mutually exclusive with the RID keyword.
For KSDS processing, if the record key does not exist, processing begins with the next record that is greater than the
rid
value. If OLDFILE is not supplied, the default file SYSUT1 is positioned accordingly.
Syntax
OLDRID(
rid
)
Parameters
Valid
rid
values for each supported file format are as follows:
  • ESDS
    Specifies the relative byte address (RBA) in a four-byte hexadecimal format:
    • X'hh…'
      Hexadecimal
  • KSDS
    Specifies the record key in one of the following formats:
    • C'c…'
      Character -- matches specified case
    • X'hh…'
      Hexadecimal
  • RRDS
    Specifies the relative record number (RRN)
  • Sequential
    Actual record number. Valid values are 1 - 999,999,999
Note
: When using a hexadecimal value, you must supply an even number of hexadecimal characters.
Example 1
This example syntax is for a KSDS file. Record processing begins for the data set referenced by the OLDFILE keyword and starts with the record that has the key value X'1000', or if that key does not exist, the next key higher. If keyword OLDFILE is not used, the default value SYSUT1's file is positioned accordingly.
COMPARE,
  OLDRID(X'1000')
Example 2
This example syntax is for RRDS and sequential files. Processing begins with the 32nd record of the data set specified by the OLDFILE keyword, or with the default value of SYSUT1.
COMPARE,
OLDRID(32)
OUTFILE
The OUTFILE keyword points to the output file. The default value is SYSUT1O, but this may have been changed during installation. The OUTFILE and INFILE can have different file organizations. OUTFILE is only valid with the COPY and GENXML commands. For the GENXML command, the output file must be a sequential file or a PDS member.
When the INFILE ddname is specified, the OUTFILE ddname is built from the first seven characters of the INFILE ddname with an O appended to it.
When the INFILE ddname is not specified, the OUTFILE ddname is built from the installation option &BAT_INFILE with an O appended to it.
Syntax
OUTFILE({[SYSUT1O | 
dsname
[(
member
)] | 
ddname
][,CLOSE|,NOCLOSE]})
Parameters
OUTFILE supports the following parameters:
  • dsname
    Identifies the data set name and optional member that contain the output records. This data set is dynamically allocated. A JCL is not required to reference this dsname.
  • ddname
    Specifies the one- to eight-character ddname of the output file. SYSUT1O is the default value.
  • CLOSE
    This parameter value closes the OUTFILE after the command has completed processing. Subsequent commands write over any previously written data. CLOSE does not work on SYSOUT=* allocations. Output of these types remains open during the entire job. CLOSE is the default value, but it may have been changed during installation.
  • NOCLOSE
    This parameter value does not close the OUTFILE after the command has completed processing. However, all data sets are closed before executing subsequent job steps.
    When the NOCLOSE parameter is used, the current job step subsequent command appends any additional records to the OUTFILE.
Note:
Both dsname(member) and ddname are optional. If both are omitted, either the CLOSE or NOCLOSE option must be selected.
Example 1
This example syntax directs all output to the data set referenced by ddname NEWMSTR. The file is closed after the command completes.
COPY, 
  OUTFILE(NEWMSTR)
Example 2
This example syntax directs any output to the data set referenced by the default ddname for OUTFILE. The shipped default value for this option is SYSUT1O, but may have been changed during installation. The default OUTFILE ddname is generated by first using the INFILE value, if supplied, and if not supplied, the installation default value, and appending an O to the end of the value. The file is not closed after the command completes. The execution of the current job step next command appends any new output to the end of the OUTFILE.
COPY,
  OUTFILE(,NOCLOSE)
Example 3
This example copies the records that are referenced by the ddname OLDMSTR to the data set referenced by the ddname OLDMSTRO. Although the ddname OLDMSTRO is not supplied by the use of the OUTFILE keyword, the name is generated because of the use of the INFILE value.
COPY,
  INFILE(OLDMSTR)
OUTLIM
The OUTLIM keyword sets the maximum number of records that are written to one of the following:
The default output file, usually SYSUT1O.
  • The overridden default output file used with the OUTFILE keyword.
  • The output file referenced by the WRITE keyword.
You can use multiple OUTLIM keywords within one command. OUTLIMs that are used outside of a SELRECIF statement are considered a
global limit
. OUTLIMs that are subordinate to the SELRECIF keyword are considered
conditional limits
. Each conditional limit is particular to the SELRECIF or IF in which it is subordinate. Global limits refer to the entire command.
OUTLIM is not reinitialized to 0 with each PDS member that it processes. As each OUTLIM conditional limit is reached, no more records are written to the associated output file for that particular OUTLIM conditional limit. When all OUTLIM conditional limits are reached, no more records are written to any output file, except for any output file associated with the global limit. When the OUTLIM global limit is reached, the command is terminated.
Syntax
OUTLIM(0 | 
number
)
Parameters
OUTLIM supports the following parameter:
  • number
    An integer value from 0 through 999,999,999. The default is 0, which means there is no limit to the number of records that are written to the associated output file.
Example 1
This example syntax limits the number of output records written to the file referenced by the ddname MSTROUT to 10,000 records.
COPY,
  OUTFILE(MSTROUT),
  OUTLIM(10000)
Example 2
This example writes a maximum of 500 records to the associated output files, either NHFILE, NJFILE, NMFILE, or NYFILE, and matching records to the default output file, usually SYSUT1O.
COPY,
  LAYOUTFILE(LAYOUT),
  SELRECIF(STATE-CODE,EQ,C'NH'),
    OUTLIM(500),    
    WRITE(NHFILE),  
  SELRECIF(STATE-CODE,EQ,C'NJ'),
    OUTLIM(500),    
    WRITE(NJFILE),  
  SELRECIF(STATE-CODE ,EQ,C'NM'),
    OUTLIM(500),    
    WRITE(NMFILE),  
  SELRECIF(STATE-CODE ,EQ,C'NY'),
    OUTLIM(500),    
    WRITE(NYFILE)   
PADCHAR
The PADCHAR keyword defines the pad character that is used to fill any uninitialized record bytes. Uninitialized record bytes may be created using commands such as COPY or with keywords like CHANGE. With COPY, uninitialized record bytes are created when copying to a larger record without specifically initializing the extra bytes in the larger record. The default value is low-values, x'00'. Supplying the PADCHAR keyword is the only way to override the default value.
Syntax
PADCHAR(
char-data
| X'00')
Parameters
PADCHAR supports the following parameter:
  • char-data
    Specify one of the following values:
    C'x'
    Designate a printable character value
    X'hh'
    Hexadecimal value. The default value is x'00'
Example
These syntax examples pads the uninitialized output record with spaces.
COPY,
  PADCHAR(x'40')
PDSSTATS
Use the PDSSTATS keyword to turn off the updating of the PDS member statistics after a member had been updated through either the CHANGE, EDIT, or REPLACE keywords.
The following rules apply to the PDSSTATS keyword:
It is only valid with the UPDATE and COPY commands.
  • It can only be issued once per command.
  • It cannot be subordinate to any selection statements including IF.
If you omit this keyword, the member statistics are updated if the member had been changed.
Syntax
PDSSTATS(Y| N)
Parameters
PDSSTATS supports the following values:
  • Y
    (Default) Update the PDS member statistics when the member had been updated.
  • N
    Do not change the PDS member statistics when the PDS member had been changed.
Example 1
This example does not update the PDS member statistics, regardless of whether the members are changed or not.
COPY,
  OUTFILE(MSTRCOPY),
  REPLACEMEM(Y),
  PDSSTATS(N),
  IF(1,0,EQ,C'PGM=RATE4A'),
    REPLACE(1,0,C'REGION=',C'REGION=6M)
Example 2
This example will not UPDATE the member PRDCOPY statistics if the member is changed.
UPDATE,
  PDSSTATS(N),
  MEMBER(PRDCOPY),
  REPLACE(1,0,C'REGION=',C'REGION=6M)
Note:
Use the MEMBER keyword to reference members directly.
POSITION
The POSITION keyword is used with the COMPARE command to limit what record positions are compared in the OLD and NEW files. If you omit this keyword, the entire record is compared. If you use POSITION multiple times within a COMPARE command, only those positions are used to determine if a record is changed or matched.
Syntax
POSITION(
{old-field-name|oldfile-position,length}[,new-field-name|,newfile-position])
POSITION(
old-field-name,length{,new-field-name|,newfile-position})
Parameters
POSITION supports the following parameters:
  • old-field-name
    Use
    old
    -
    field-name
    when referencing a data field that is defined in the record layout. The layout must be available to the job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE.
    When this parameter is supplied, the keyword
    oldfile-position
    and
    length
    are retrieved from the
    old-field-name
    definition. 
  • oldfile-position
    Specifies the starting field position in the OLDFILE record. Valid choices are as follows:
    • 1 - 32760
      The actual position number.
  • length
    Specifies the number of record positions to be compared. If you specify 0, the positions scanned start at the position parameters to the end of the records. Valid integer values are 0 - 32760.
  • new-field-name
    Use
    new-field-name
    when referencing a data field that is defined in the NEW file record layout. The layout must be available to the job step. For more information about how to make the NEW record layout available, see the keyword LAYOUTFILEN.
    Note:
    When this parameter is supplied, the keyword
    new-position
    and
    length
    are retrieved from the
    new-field-name
    definition. If the
    old-field-name
    and
    new-field-name
    lengths are different, the length that is used is the shorter of the two lengths. 
  • newfile-position
    Specifies the starting field position in the NEWFILE record to be compared. When this parameter is omitted its value is the same as the
    oldfile-position
    , or, if supplied, the
    old-field-name
     starting position. Valid numeric values are as follows:
    • 1 - 32760
      The actual position number.
Example 1
This example syntax compares the field COMPARE-FIELD in the old and new files. Both the oldfile-position and the newfile-position are retrieved from the defined starting position of the field.
COMPARE,
  LAYOUTFILE(LAYOUT),
  POSITION(COMPARE-FIELD)
Example 2
This example syntax compares positions 32, 33, 34, and 35 of the OLDFILE to positions 65, 66, 67 and 68 of the NEWFILE.
COMPARE,
  POSITION(32,4,65)
You can obtain the same results using the old-field-name parameter.
COMPARE,
  LAYOUTFILE(LAYOUT),
  POSITION(COMPARE-FIELD,65)
Example 3
This example syntax compares only positions 32, 33, 34, and 70, 71, 72 of both the NEWFILE and OLDFILE.
COMPARE,
  POSITION(32,3,32),
  POSITION(70,3,70)
Example 4
This example syntax compares the field COMPARE-FIELD in the old file to NEW_COMPARE_FIELD in the new file. The oldfile-position is retrieved from the field defined starting position in the file referenced by LAYOUT. The newfile-position is retrieved from the field defined starting position in the file that is referenced by LAYOUTN.
COMPARE,
  LAYOUTFILE(LAYOUT),
  LAYOUTFILEN(LAYOUTN),
  POSITION(COMPARE-FIELD,NEW_COMPARE_FIELD)
PRINTLIM
The PRINTLIM keyword sets the maximum number of records that are written to the primary listing ddname, usually SYSLIST. You can use multiple PRINTLIM keywords within one command. PRINTLIMs that are used outside of the SELRECIF statement are considered a global limit. PRINTLIMs that are subordinate to a SELRECIF keyword are considered conditional limits. Each conditional limit is particular to the SELRECIF in which it is subordinate. Global limits pertain to the entire command.
As each PRINTLIM conditional limit is reached, no more records are written to SYSLIST for that PRINTLIM conditional limit. When all PRINTLIM conditional limits are reached, no more records are written to any listing ddname, except for any listing ddname associated with the global limit. When the PRINTLIM global limit is reached, the command is terminated.
Syntax
PRINTLIM(0 | 
number
)
Parameters
PRINTLIM supports the following parameter:
  • number
    An integer value from 0 through 999,999,999. The default value is 0, which means there is no limit to the number or records that are written to SYSLIST.
Example 1
This example limits the number of records that are printed to SYSLIST, if allocated, otherwise to SYSPRINT, to 10,000 records. The PRINT command is terminated once the PRINTLIM value is reached, and the input file is closed. The COPY command starts processing with the first record from the input file.
PRINT,
  PRINTLIM(10000)
COPY
Example 2
This example prints the first 50 records that contain a packed value of 002, or 003 for field CUST-TOTAL-AUTOS. Once the PRINTLIM is reached, processing continues but writing more records to SYSLIST ceases. Therefore, the accumulated total reflects the file's total and not only the first 50 records that meet the IF criteria.
READ,
  LAYOUTFILE(LAYOUT),
  ACCUM(CUST-TOTAL-AUTOS,'Total Autos'),
  IF(CUST-TOTAL-AUTOS,GT,N'1'),
    AND(CUST-TOTAL-AUTOS,LT,N'4'),
      PRINTREC, 
      PRINTLIM(50)  
PRINTREC
The PRINTREC keyword provides printing capability of specific records to commands that typically do not contain an inherent print function, such as COPY. Include any of the print format keywords with PRINTREC to format the printed record by record.
Syntax
PRINTREC
Parameters
PRINTREC accepts no parameters.
Example 1
This READ example prints every record that is read. It uses the default formatting values. The shipped default values are; FORMAT(CHARACTER), LAYOUTRC(4), and PRINTLIM(0).
READ 
  PRINTREC
Example 2
This COPY example prints every record that contains the state code for California, CA, at position 10 of the input record, with the copybook that is associated with ddname CA. It also prints each record that contains a CO in position 10 with the copybook that is associated with the ddname CO. All records are copied to the output file SYSUT1O.
COPY,
  LAYOUTFILE(LAYOUT),
  FORMAT(S),
  IF(STATE-CODE,EQ,C'CA'),
    PRINTREC,   
    LAYOUTFILE(CA), 
  IF(STATE-CODE,EQ,C'CO'),
    PRINTREC,   
    LAYOUTFILE(CO)  
Keywords
Following is a complete list of the keywords that you can use with the PRINTREC keyword.
  • FORMAT
  • LAYOUTFILE
  • LAYOUTRC
  • PRINTLIM
PROPERTIESEXCLUDE
The PROPERTIESEXCLUDE keyword specifies which program properties to exclude from the COMPARE PROGRAM command processing. This keyword is only valid with the COMPARE PROGRAM command. It can only be used once per command and is mutually exclusive with the PROPERTIESINCLUDE keyword. At least one keyword must be specified.
By default, no program properties are excluded from the comparison.
Syntax
PROPERTIESEXCLUDE([ATTRIBUTES][,CONTENT][,CSECTDATE][,CSECTNAME][,CSECTSIZE]
        [,ENTRYPOINT][,ESD][,IDRUSER][,IDRZAP][,LINKDATE][,TOTALSIZE]
        [,TRANSLATOR])
Parameters
PROPERTIESEXCLUDE supports the following parameters:
  • ATTRIBUTES
    Specifies the program link attributes: reentrant, reusable, refreshable, authorization code, amode, rmode, and SSI
    Alias: ATTR
  • CONTENT
    Specifies the actual module text
    Alias: CONT
  • CSECTDATE
    Specifies the date carried in Binder IDR-B records
    Alias: CSECTD
  • CSECTNAME
    Specifies the name of the CSECTs
    Alias: CSECTN
  • CSECTSIZE
    Specifies the size of the CSECTs
    Alias: CSECTS
  • ENTRYPOINT
    Specifies the load module entrypoint
    Alias: ENTRYP
  • ESD
    Identifies the external symbol information that is carried in Binder B_ESD records (for example, external references)
  • IDRUSER
    Information that is carried in Binder B_IDRU records (added as a result of the Binder IDENTIFY statement or programmatically by, for example, Endevor)
    Alias: IDRU
  • IDRZAP
    IDR ZAP information carried in Binder B_IDRZ records
    Alias: IDRZ
  • LINKDATE
    Identifies the data and time the program was linked
    Alias: LINKD
  • TOTALSIZE
    Identifies the size of the load module or program object
    Alias: TOTALS
  • TRANSLATOR
    Specifies the compiler information
    Alias: TRANSL
Example
This example excludes the CONTENT and IDRZAP program properties.
PROPERTIESEXCLUDE(CONTENT,IDRZAP)
PROPERTIESINCLUDE
The PROPERTIESINCLUDE keyword specifies which program properties to include in the COMPARE PROGRAM command processing. This keyword is only valid with the COMPARE PROGRAM command. It can only be used once per command and is mutually exclusive with the PROPERTIESEXCLUDE keyword. At least one keyword must be specified.
By default, all program properties are included in the comparison.
Syntax
PROPERTIESINCLUDE([ATTRIBUTES][,CONTENT][,CSECTDATE][,CSECTNAME][,CSECTSIZE]
        [,ENTRYPOINT][,ESD][,IDRUSER][,IDRZAP][,LINKDATE][,TOTALSIZE]
        [,TRANSLATOR])
Parameters
PROPERTIESINCLUDE supports same parameters as PROPERTIESEXCLUDE.
Example
This example selects the ATTRIBUTES, CONTENT and LINKDATE program properties.
PROPERTIESINCLUDE(ATTRIBUTES,CONTENT,LINKDATE)
RDW
The RDW keyword controls the inclusion of the four-byte record descriptor word of variable length records in record positions 1 - 4. The first 2 bytes of the RDW contain the record length plus the length of the RDW, which is 4. This value is in hex. Bytes three and four contain low-values.
Syntax
RDW(N | Y)
Parameters
RDW supports the following parameters:
  • N
    For variable length records, the four-byte record descriptor word does not display and is not considered in positional parameters. The first data byte of the record is position 1. N is the default value, but it may have been changed during installation.
  • Y
    For variable length records, the four-byte record descriptor word displays in the output of the PRINT command or is considered in the input positional parameter of any keyword. The first data byte of the input record is position 5 and the RDW is in position 1. With RDW(Y), the RDW is made available to the current command and its keywords. For example, it is available to move to a specific position within a record, to query its value, or to compare it to another RDW.
Example 1
This example copies a variable length record file to a fixed-length record file and includes the RDW in the fixed-length file. The MOVE keyword moves the RDW starting at position 1 of the input record to data position 1 of the output record.
READ,
  INFILE(VBFILE),
  RDW(Y),
  MOVE(1,0,1),
  WRITE(FBFILE)
Example 2
This example identifies any records with a length of 80. (54 is the hex value of the record length (80) + the RDW(4)). Only the record data are moved to the output buffer, before being written to the ddname LRECL80. The first four bytes of the from-position are not referenced. This is because the RDW value places the RDW in these first four bytes of the from-data.
READ,
  RDW(Y),
  IF(1,EQ,X'0054'),
    MOVE(1,0,5),    
    WRITE(LRECL80)  
REFFILE
The REFFILE keyword references the record reformatting data set. The reformatting data set contains the control statements that reformat an input file to the record layout of another file. This includes deleting and inserting new fields, increasing or reducing field lengths, or rearranging the current field locations. The data set must be created previously to execute the command. Use Option 3.11 in the ISPF interface to create this file. REFFILE is only valid with the COPY command.
Syntax
REFFILE(
dsname
[(
member
)]|
ddname
)
Parameters
REFFILE supports the following parameters:
  • dsname
    Identifies the data set name and optional member that contains the record reformatting criteria. This data set is dynamically allocated. A JCL is not required to reference this dsname.
  • ddname
    Identifies the ddname that references the reformat data set name and optional member.
Example
This ddname, REFORMAT, references the JCL statement that contains the data set name and member of the reformat member. The output file is formatted according to the reformat member.
COPY , 
  INFILE(SYSUT1), 
  OUTFILE(SYSUT1O), 
  REFFILE(REFORMAT),
  REPLACEKEYS(N)
REPLACE
The REPLACE keyword overwrites the data that are found at a particular record position according to the selection criteria. You can use REPLACE more than once during a command.
The
to-data
and
from-data
may be unequal in length. Unlike the CHANGE keyword, REPLACE makes no attempt to shift data to accommodate for the unequal lengths. If the
to-data
is less than the
from-data
, only that portion of the
from-data
is overwritten. If the
to-data
is greater than the
from-data
, the data immediately to the right of the
from-data
is overwritten, but only up to the current record length. REPLACE makes no attempt to change the record size for variable record lengths. With either
field-name
or
to-field-name
only the data that are defined by these fields are replaced. No data outside of these fields are changed.
Syntax
REPLACE({field-name|position}
,
to-data)
REPLACE({field-name|position[,scan
-
length]},operator,from-data,{to-field-name|to-position},to-data[,ALL])
Parameters
REPLACE supports the following parameters:
  • field-name
    Use
    field-name
    when referencing a data field that is defined in the record layout. The layout must be available to the job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE.
    Note
    : When this parameter is supplied, the keyword position, length, decimal-positions, and data type are all retrieved from the
    field-name
    definition, and are used to validate the
    from-data
    and
    to-data
    formats. 
  • position
    Specifies the position to begin scanning. Valid choices are as follows:
    • 1 - 32760
      The actual position number.
    • +nnn or - nnn
      The relative position to the record current location.
  • scan-length
    Specifies the amount of data to scan. A scan-length of 0 means that the entire record is scanned, starting at the position parameter value. Valid values are 0 - 32760. If the
    scan-length
    is omitted, no scanning is done.
  • operator
    Specify one of the following values:
    • CO
      Contains -- If a
      field-name
      is supplied, the
      position
      and
      scan-length
      values are retrieved from the
      field-name
      's defined starting position and physical length. If
      position
      and
      scan-length
      are supplied, the record is scanned for the
      data
      beginning at
      position
      for a length of
      scan-length
      .
    • EQ
      Equal
    • NE
      Not equal
    • GT
      Greater than
    • GE
      Greater than or equal to
    • LE
      Less than or equal to
    • LT
      Less than
  • from-data
    Specify one of the following values:
    • C'c…
      '
      Character -- matches specified case
    • N'n…
      '
      Numeric -- processes the literal as defined by the
      field-name
      parameter when
      field-name
      is defined as a numeric field.
    • P'n…
      '
      Packed
    • T'c…
      '
      Text -- matches both lowercase and uppercase alphabetic characters. Alphanumeric characters are permitted.
    • X'hh…
      '
      Hexadecimal
  • to-field-name
    Use
    to-field-name
    to update a field other than the field-name value. The layout must be available to the job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE.
    Note:
    When this parameter is supplied, the keyword
    position
    ,
    length
    ,
    decimal-positions
    , and
    data type
    are all retrieved from the
    to-field-name
    definition, and are used to validate the
    to-data
  • to-position
    The starting field position in the record. If
    to-position
    and ALL are both supplied, the keyword receives a syntax error. Valid values are as follows:
    • 1 - 32760
      The actual position number
    • +nnn or - nnn
      The relative position to the current location of the record 
  • to-data
    Specify one of the following values:
    • C'c…
      '
      Character -- matches specified case.
    • N'n…
      '
      Numeric -- processes the literal as defined by the
      field-name
      parameter when
      field-name
      is defined as a numeric field.
    • P'n…
      '
      Packed
    • T'c…
      '
      Text -- uppercase letters are substituted for their lowercase counterparts. Alphanumeric data is permitted.
    • X'hh…
      '
      Hexadecimal
  • ALL
    Replaces every occurrence in the record within the scan-length. If
    to-position
    is also supplied, the command receives a syntax error. When ALL is specified, the scan-length parameter must be also supplied.
Example 1
This example syntax replaces every occurrence of the letter Y found in positions 40 through 59 with the letter X.
UPDATE,
  REPLACE(40,20,EQ,C'Y',C'X',ALL)
You can obtain the same results by using the field-name parameter:
UPDATE,
  LAYOUTFILE(LAYOUT),
  REPLACE(FIELD-NAME,CO,C'Y',C'X',ALL)
Example 2
This example syntax replaces the CUST-MONTH-SALES values with zero in the format as defined by the layout.
UPDATE,
  LAYOUTFILE(LAYOUT),
  REPLACE(CUST-MONTH-SALES,N'0')
Example 3
This example syntax replaces the 3 bytes at position 95 with XYZ if position 16 of the INFILE does not equal the string ABC.
UPDATE,
  REPLACE(16,NE,C'ABC',95,C'XYZ')
You can obtain the same results by using the field-name and the to-field-name parameters.
UPDATE,
  LAYOUTFILE(LAYOUT),
  REPLACE(FIELD-ONE,NE,C'ABC',FIELD-TWO,C'XYZ')
REPLACEKEY
The REPLACEKEY keyword is used to either replace or not replace records with identical keys in populated KSDS data sets, and is only valid with the COPY command. The default value is N. This keyword can only be used once per command.
Syntax
REPLACEKEY(N | Y)
Parameters
REPLACEKEY supports the following values:
  • N
    This option replaces existing duplicate keys in the target file. Otherwise it inserts the source record into the target file. N is the default value.
  • Y
    This option replaces any duplicate keys in the target file with those from the source file. Otherwise, the source record is inserted.
Example
This example syntax copies KSDS to KSDSO. If any duplicate keys are found, the record is not copied but the processing continues, and the command returns a condition code of four.
COPY,
  INFILE(KSDS),
  REPLACEKEY(N)
REPLACEMEM
The REPLACEMEM keyword is used to either replace or not replace identically named members in a target PDS. The default value is N. This keyword is only valid with the COPY command, and can only be used once per command. REPLACEMEM is ignored when the OUTFILE keyword references a sequential file.
Syntax
REPLACEMEM(N | Y)
Parameters
REPLACEMEM supports the following values:
  • N
    (Default) Identically named members in the target PDS are not overwritten by the source member.
  • Y
    Identically named members in the target PDS are overwritten by the source member.
Example
In this example any duplicate named members in the output file SYSUT1O are not overwritten with SYSUT1's duplicate named member. Processing still continues and the command returns a condition code of 4.
COPY,
  REPLACEMEM(N)
RID
The RID keyword positions the input data set to a specific record before processing begins. For KSDS processing, that specific record is the record key. If the KSDS record key does not exist, processing begins with the subsequent record. This keyword is mutually exclusive with the keywords NEWRID and OLDRID. For other file types the RID value is the record number.
Syntax
RID(
rid
)
Parameters
RID supports the following parameters:
  • ESDS
    Specifies the relative byte address (RBA), expressed in a 4-byte hexadecimal format.
  • KSDS
    The record key, expressed in either of the following ways:
    • C'c…
      '
      Character -- matches specified case
    • X'hh…
      '
      Hexadecimal
  • RRDS
    Specifies the relative record number (RRN)
  • Sequential
    Specifies the actual record number. Valid values are 1 - 999,999,999
Note
: When using a hexadecimal value, supply an even number of hexadecimal characters.
Example 1
These example syntaxes for a KSDS file begin with the record that has the key value of character 1000. If that key does not exist, processing begins with the subsequent record.
In this example if the record key C'1000' did not exist, the next record greater than C'1000' is where printing would begin.
PRINT,
  RID(C'1000'),
  DIRECTION(FORWARD)
In this example if the record key C'1000' did not exist, the next record less than C'1000' is where printing would begin.
PRINT,
  RID(C'1000'),
  DIRECTION(BACKWARD)
Example 2
For RRDS and sequential files, copying begins with the 32nd record of the input data set, default value SYSUT1.
COPY,
  RID(32)
SELECT
Use the SELECT keyword to select the
n
th record for processing. When used with selection criteria, every
n
th record occurrence that meets the selection criteria is selected. SELECT is subordinate to IF, SELMEMIF, SELRECIF, and SKIPRECIF.
Syntax
SELECT(0 | 
number
)
Parameters
SELECT supports the following parameter:
  • number
    Specifies an integer from 0 through 999,999,999. 0 is the default and is used to select every record.
Example
This example syntax copies every tenth record that contains a DOB-YEAR field value of N'1945'.
COPY,
  LAYOUFILE(LAYOUT),
  SELRECIF(DOB-YEAR,EQ,N'1945'),
    SELECT(10)
SELLIM
The SELLIM keyword sets the maximum number of times a selection criteria subordinate action can be executed. SELLIM is only valid with the COMPARE, COPY, PRINT, READ, and UPDATE commands. You can use multiple SELLIM keywords within one command. SELLIMs that are used outside of the SELRECIF statement are considered a global limit. SELLIMs that are subordinate to a SELRECIF keyword are considered conditional limits. Each conditional limit is particular to the SELRECIF in which it is subordinate. Global limits pertain to the entire command.
SELLIM is not reinitialized to 0 with each PDS member that it processes. As each SELLIM conditional limit is reached, the associated IF keyword and its subordinate actions are excluded from further processing.
When all SELLIM conditional limits are reached, no more subordinate actions are processed. When the SELLIM global limit is reached, the command is terminated.
Syntax
SELLIM(0 | 
number
)
Parameters
SELLIM supports the following parameter:
  • number
    Any integer value from 0 through 999,999,999. The default value is 0, which means there is no limit to the number of times a subordinate action can be executed.
Example 1
The SELLIM is set to 50. Each time a SELRECIF selection condition is met, the record is written to the appropriate file. No more records are written to either CTFILE or TNFILE once a total of 50 records have been written to both of them combined.
READ,
  LAYOUTFILE(LAYOUT),
  SELLIM(50),
  SELRECIF(STATE-CODE,EQ,C'CT'),
    MOVE(1,0,1),    
    WRITE(CTFILE),  
  SELRECIF(STATE-CODE,EQ,C'TN'),
    MOVE(1,0,1),    
    WRITE(TNFILE)   
Example 2
Each time a SELRECIF's subordinate actions are processed, the SELLIM for that particular SELRECIF is incremented. In this particular case, each SELRECIF's actions are processed 50 times, thus limiting the number of records that are written to both the CTFILE and TNFILE to 50, for a total of 100.
READ,
  LAYOUTFILE(LAYOUT), 
  MOVE(CLEAR),   
  SELRECIF(STATE-CODE,EQ,C'CT'),
    SELLIM(50), 
    MOVE(1,0,1),    
    WRITE(CTFILE),  
  SELRECIF(STATE-CODE,EQ,C'TN'),
    SELLIM(50), 
    MOVE(1,0,1),    
    WRITE(TNFILE)   
SELMEMIF, AND, OR
The SELMEMIF keyword lets you select specific members, depending on the selection criteria. Once the member meets the selection criteria, the member is acted on by the command, for example, COPY and PRINT, and any subordinate keywords are processed. If the keyword MEMBER is also supplied, the two keywords are ANDed together. A member is only selected if it meets both of the MEMBER and SELMEMIF conditions.
The AND/OR keywords are only valid immediately following the SELMEMIF keyword, and the IF, SKIPRECIF and SELRECIF keywords.
When a SELMEMIF keyword immediately follows another SELMEMIF/AND/OR keyword, the second SELMEMIF is treated like an AND statement.
When SELMEMIFs are separated by actions, subsequent SELMEMIFs are not subordinate to the previous SELMEMIF. The last action and the STOP keyword subordinate to a SELMEMIF/AND/OR ends the SELMEMIF/AND/ORs actions.
Syntax
SELMEMIF({
field-name
|
position
[
,scan-length
]},
operator
,
data
[,…])
       ({   
field-name
|
position,scan-length
},
data-type
[,…])
SELMEMIF({
field-name
|
position,scan-length
},
operator
,{
field-name
|
position
})
AND({
field-name
|
position
[
,scan-length
]},
operator
,
data
[,…])
   ({
field-name
|
position,scan-length
},
data-type
[,…])
AND({
field-name
|
position,scan-length
},
operator
,{
field-name
|
position
})
OR({
field-name
|
position
[
,scan-length
]},
operator
,
data
[,…])
  ({
field-name
|
position,scan-length
},
data-type
[,…])
OR({
field-name
|
position,scan-length
},
operator
,{
field-name
|
position
})
You can repeat the parameter sequence for each of these commands: this is noted by the [,…]. Each repetition is an implied OR. For example, the following SELMEMIF keyword looks for the characters 'MY.TEST.FILE' or 'MY.PROD.FILE' anywhere within the record.
SELMEMIF(1,0,EQ,C'MY.TEST.FILE',1,0,EQ,C'MY.PROD.FILE')
You can also use the data definition to imply an OR condition. If data and position are the same, but the values different, you can change the data. This example is a different way of writing the example.
SELMEMIF(1,0,EQ,C'MY.TEST.FILE,MY.PROD.FILE')
When the data is different, but the position is the same, you can still use an implied OR by listing the different data values.
SELMEMIF(1,0,EQ,C'++INCLUDE COPYBOOK',T'copybook')
Parameters
SELMEMIF supports the following parameters:
  • field-name
    Use
    field-name
    when referencing a data field that is defined in the record layout. The layout must be available to the job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE. When this parameter is supplied, the keyword position, length, decimal-positions, and data type (when supplied), are all retrieved from the
    field-name
    definition, and are used to validate the
    data
    format. 
  • position
    Specifies the starting field positioning the record. Valid values are the following:
    • 1 - 32760
      The actual position number
    • +nnn or - nnn
      The relative position to the current location of the record 
  • scan-length
    Specifies the amount of data to compare. If 0, the scanning starts at the position parameter value to the record length. Valid values are 0 - 32760. If the
    scan-length
    is omitted, no scanning is done.
  • operator
    Specify one of the following values:
    • CO
      Contains -- If a
      field-name
      is supplied, the
      position
      and
      scan-length
      values are retrieved from the
      field-name
       defined starting position and physical length. If
      position
      and
      scan-length
      are supplied, the record is scanned for the
      data
      beginning at
      position
      for a length of
      scan-length
      .
    • EQ
      Equal
    • NE
      Not equal
    • GT
      Greater than
    • GE
      Greater than or equal to
    • LE
      Less than or equal to
    • LT
      Less than
  • data
    Specify one of the following values:
    • C'c…'
      Character -- matches specified case
    • N'n…
      '
      Numeric -- processes the literal as defined by the
      field-name
      parameter. Define the
      field-name
      parameter as a numeric field, which is only valid when you supply a
      field-name
      parameter.
    • P'n…
      '
      Packed
    • T'x…
      '
      Text -- matches both lowercase and uppercase alphabetic characters. Alphanumeric characters are permitted.
    • X'hh…
      '
      Hexadecimal
  • data - type
    Valid choices are as follows:
    • EQP
      Valid packed decimal data
    • NEP
      Not valid packed decimal data
    • EQN
      Valid numeric data
    • NEN
      Not valid numeric data
Example
This example command and keyword syntax copies the member if the first nine characters of any of the member records begin with either the character string '//FMMVS31' or '//FMMVS41'. No other members are copied:
COPY,
  REPLACEMEM(Y),
  SELMEMIF(1,EQ,C'//FMMVS31'),
    OR(1,EQ,C'//FMMVS41')
An equivalent command follows:
COPY,
  REPLACEMEM(Y),
  SELMEMIF(1,EQ,C'//FMMVS31,//FMMVS41')
Keywords
The following is a complete list of valid keywords that can be subordinate to the SELMEMIF, AND, OR keywords.
  • ACCUM
  • CHANGE
  • EDIT
  • IF, AND, OR
  • MOVE
  • NEXTREC
  • PADCHAR
  • POSITION
  • REPLACE
  • SELECT
  • SELLIM
  • SELMEMIF, AND, OR
  • SELRECIF, AND, OR
  • SKIP
  • STOP
  • WRITE
SELRECIF, AND, OR
Use the SELRECIF keyword to select specific records according to selection criteria. Once the record meets the selection criteria, the record is acted on by the command, and subordinate keywords are processed.
The AND/OR keywords are only valid immediately following the SELRECIF keyword, and the IF, SKIPRECIF, and SELMEMIF keywords.
When a SELRECIF keyword immediately follows another SELRECIF/AND/OR keyword, the second SELRECIF is treated like an AND statement.
When SELRECIFs are separated by actions, subsequent SELRECIFs are not subordinate to the previous SELRECIF. The last action and the STOP keyword subordinate to a SELRECIF/AND/OR ends the SELRECIF/AND/ORs actions.
Syntax
SELRECIF({
field-name
|
position
[
,scan-length
]},
operator
,
data
[,…])
       ({   
field-name
|
position,scan-length
},
data-type
[,…])
SELRECIF({
field-name
|
position,scan-length
},
operator
,{
field-name
|
position
})
AND({
field-name
|
position
[
,scan-length
]},
operator
,
data
[,…])
   ({
field-name
|
position,scan-length
},
data-type
[,…])
AND({
field-name
|
position,scan-length
},
operator
,{
field-name
|
position
})
OR({
field-name
|
position
[
,scan-length
]},
operator
,
data
[,…])
  ({
field-name
|
position,scan-length
},
data-type
[,…])
OR({
field-name
|
position,scan-length
},
operator
,{
field-name
|
position
})
Use the data definition to imply an OR condition. If the data and position are identical, but the values different, simply change the data.
SELRECIF(105,15,EQ,C'A+ Widgets,A Widgets')
When the data is different, but the position is identical, use an implied OR by listing the different data values.
SELRECIF(105,15,EQ,C'A+ Widgets',T'A WIDGETS')
Parameters
SELRECIF supports the following parameters:
  • field-name
    Use
    field-name
    when referencing a data field that is defined in the record layout. The layout must be available to the job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE.
    Note:
    When this parameter is supplied, the keyword position, length, decimal-positions, and data type (when supplied), are all retrieved from the
    field-name
    definition, and are used to validate the
    data
    format. 
  • position
    Specifies the starting field positioning the record. Valid values are as follows:
    • 1 - 32760
      The actual position number
    • +nnn or - nnn
      The relative position to the current location of the record 
  • scan-length
    The amount of data to scan. If 0, scanning starts at the position parameter value to the record length. Valid values are 0 - 32760. If the scan-length is omitted, no scanning is done.
  • operator
    Specify one of the following values:
    • CO
      Contains -- If a
      field-name
      is supplied, the
      position
      and
      scan-length
      values are retrieved from the
      field-name
       defined starting position and physical length. If
      position
      and
      scan-length
      are supplied, the record is scanned for the
      data
      beginning at
      position
      for a length of
      scan-length
      .
    • EQ
      Equal
    • NE
      Not equal
    • GT
      Greater than
    • GE
      Greater than or equal to
    • LE
      Less than or equal to
    • LT
      Less than
  • data
    Specify one of the following values:
    • C'c…'
      Character -- matches specified case
    • N'n…
      '
      Numeric -- processes the literal as defined by the
      field-name
      parameter. You must define the
      field-name
      parameter as a numeric field, and it is only valid when you supply a
      field-name
      parameter.
    • P'n…
      '
      Packed
    • T'x…
      '
      Text -- matches both lowercase and uppercase alphabetic characters. Alphanumeric characters are permitted.
    • X'hh…
      '
      Hexadecimal
  • data - type
    Specify one of the following values:
    • EQP
      Valid packed decimal data
    • NEP
      Not valid packed decimal data
    • EQN
      Valid numeric data
    • NEN
      Not valid numeric data
Keywords
The following is a complete list of the valid keywords that are subordinate to the SELRECIF, AND, OR keywords.
  • ACCUM
  • CHANGE
  • EDIT
  • IF, AND, OR
  • MOVE
  • OUTLIM
  • PADCHAR
  • POSITION
  • PRINTLIM
  • REPLACE
  • SELECT
  • SELLIM
  • SELRECIF, AND, OR
  • SKIP
  • STOP
  • WRITE
Example 1
This example syntax overwrites record positions 8 and 9 with 03 if record field DOB-MONTH equals one of the character strings 'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV' or 'DEC'. No other records are updated.
UPDATE,
  LAYOUTFILE(LAYOUT),
  SELRECIF(DOB-MONTH,EQ,C'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC'),
    REPLACE(8,C'03')    
Example 2
This example syntax examines the packed-field for non-packed data, and copies those records to the outfile.
COPY,
  LAYOUTFILE(LAYOUT),
  SELRECIF(PACKED-FIELD,NEP)
SETRC
Use SETRC to set the command return code after processing. The last SETRC found in the control statement is returned.
Syntax
SETRC(
return-code
)
Parameters
SETRC supports the following parameter:
  • return-code
    An integer value from 0 through 4095.
Example
This example syntax stops processing, and returns a condition code of 8, once a non-packed value is detected in the field PACKED-FIELD.
COPY,
  LAYOUTFILE(LAYOUT),
  SETRC(0),
  IF(PACKED-FIELD,NEP),
    SETRC(8),
    STOP
SKIP
When SKIP is specified before any conditional keywords such as SELRECIF or IF, the SKIP keyword specifies the number of records at the beginning of the file that is bypassed before one is chosen for processing. When SKIP is used with the SELRECIF keyword, the records matching the selection criteria are bypassed. When used with the IF keyword, actions that are subordinate to the IF are bypassed. Do not use SKIP to position the input file for its initial read. Use RID, NEWRID, or OLDRID to position the file.
Syntax
SKIP(
number
)
Parameters
SKIP supports one parameter.
  • number
    An integer from 0 through 999,999,999. If 0 is used, no records are skipped.
Example 1
Select the 21st and subsequent records for processing.
COPY,
  SKIP(20)
Example 2
Copy a file and bypass all records for which the CUST-PURCHASE-CODE does not equal an A and also bypass the first 20 records that do match the SELRECIF criteria. Only the 21st and subsequent records matching the SELRECIF are copied.
COPY,
  LAYOUTFILE(LAYOUT),
  SELRECIF(CUST-PURCHASE-CODE,EQ,C'A'),
    SKIP(20)    
Example 3
Copy all records in the file, and CHANGE the CUST-REWARD-LEVEL from 706 to 859 in the 21st and subsequent records whose CUST-PURCHASE-CODE equal an A.
COPY,
  IF(1,5,EQ,C'A'),
    SKIP(20),   
    CHANGE(62,EQ,C'706',C'859') 
SKIPRECIF
Use the SKIPRECIF keyword to eliminate specific records from the default output file, SYSUT1O. When the record matches the selection criteria, the record is
not
written to the default output file, but any subordinate keywords to the selection criteria are executed.
The AND/OR keywords are only valid immediately following the SKIPRECIF keyword, and the IF, SELMEMIF, and SELRECIF keywords.
When a SKIPRECIF keyword immediately follows another SKIPRECIF/AND/OR keyword, the second SKIPRECIF is treated like an AND statement.
When SKIPRECIFs are separated by actions, subsequent SKIPRECIFs are not subordinate to the previous SKIPRECIF. The last action and the STOP keyword subordinate to a SKIPRECIF/AND/OR ends the SKIPRECIF/AND/ORs actions.
Syntax
SKIPRECIF({
field-name
|
position
[
,scan-length
]},
operator
,
data
[,…])
       ({   
field-name
|
position,scan-length
},
data-type
[,…])
SKIPRECIF({
field-name
|
position,scan-length
},
operator
,{
field-name
|
position
})
AND({
field-name
|
position
[
,scan-length
]},
operator
,
data
[,…])
   ({
field-name
|
position,scan-length
},
data-type
[,…])
AND({
field-name
|
position,scan-length
},
operator
,{
field-name
|
position
})
OR({
field-name
|
position
[
,scan-length
]},
operator
,
data
[,…])
  ({
field-name
|
position,scan-length
},
data-type
[,…])
OR({
field-name
|
position,scan-length
},
operator
,{
field-name
|
position
})
Use the data definition to imply an OR condition. If the data and record position are the same, you can change the data value. This example does not process records that contain either a 5-byte packed value of 0 or 50000 starting at record position 93. However, the ACCUM keyword executes when the conditional is met.
SKIPRECIF(93,5,EQ,P'00000,50000'),
  ACCUM(93,5,P,'TOTAL:')
When the data is different, but the position is the same, you can still use an implied OR by listing the different data values.
SKIPRECIF(105,15,EQ,C'A+ Widgets',T'A WIDGETS')
Parameters
SKIPRECIF supports the following parameters:
  • field-name
    Use
    field-name
    when referencing a data field that is defined in the record layout. The layout must be available to the job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE.
    Note:
    When you supply this parameter, the keyword position, length, decimal-positions, and data type (when supplied), are all retrieved from the
    field-name
    definition, and are used to validate the
    data
    format. 
  • position
    Specifies the starting field positioning the record. Valid values are as follows:
    • 1 - 32760
      The actual position number
    • +nnn or - nnn
      The relative position to the current location of the record
  • scan-length
    Specifies the amount of data to scan. If 0, scanning is done starting at the position parameter value to the record length. Valid values are 0 - 32760. If you omit the
    scan-length
    , no scanning is done.
  • operator
    Specify one of the following values:
    • CO
      Contains -- If a
      field-name
      is supplied, the
      position
      and
      scan-length
      values are retrieved from the
      field-name
       defined starting position and physical length. If
      position
      and
      scan-length
      are supplied, the record is scanned for the
      data
      beginning at
      position
      for a length of
      scan-length
      .
    • EQ
      Equal
    • NE
      Not equal
    • GT
      Greater than
    • GE
      Greater than or equal to
    • LE
      Less than or equal to
    • LT
      Less than
  • data
    Specify one of the following values:
    • C'c…'
      Character -- matches specified case
    • N'n…
      '
      Numeric -- processes the literal as defined by the
      field-name
      parameter. You must define the
      field-name
      parameter as a numeric field, and it is only valid when you supply a
      field-name
      parameter.
    • P'n…
      '
      Packed
    • T'x…
      '
      Text -- matches both lowercase and uppercase alphabetic characters. Alphanumeric characters are permitted.
    • X'hh…
      '
      Hexadecimal
  • data - type
    Specify one of the following values:
    • EQP
      Valid packed decimal data
    • NEP
      Not valid packed decimal data
    • EQN
      Valid numeric data
    • NEN
      Not valid numeric data
Keywords
The following is a complete list of the valid keywords that are subordinate to the SKIPRECIF, AND, OR keywords.
  • ACCUM
  • CHANGE
  • EDIT
  • IF, AND, OR
  • MOVE
  • PADCHAR
  • REPLACE
  • SELECT
  • SELLIM
  • SKIP
  • STOP
  • WRITE
Example
This example copies all records whose CUST-PURCHASE-CODE value is not equal to an 'A', to the output file NONADATA, but it writes all records whose CUST-PURCHASE-CODE value is equal to an 'A', to the output file ADATA.
COPY,
  LAYOUTFILE(LAYOUT),
  OUTFILE(NONADATA),
  SKIPRECIF(CUST-PURCHASE-CODE,EQ,C'A'),
    WRITE(ADATA)    
STOP
The STOP keyword halts processing of the current command and starts processing any subsequent commands. If there are no subsequent commands, the job step is stopped. STOP is also considered the last action when subordinate to an IF/AND/OR.
Syntax
STOP[({CLOSE | NOCLOSE})]
Parameters
STOP supports the following parameters:
  • CLOSE
    This parameter value closes the INFILE when the STOP keyword is processed. This is the default value, but it may have been changed during installation.
  • NOCLOSE
    This parameter value does not close the INFILE when the STOP keyword is processed. However, all data sets are closed before executing subsequent job steps.
    When the NOCLOSE parameter is used, the current job step subsequent command begins processing with the record that matched the STOP selection criteria.
Note:
If the INFILE keyword is present, and CLOSE/NOCLOSE is not specified with the STOP keyword, STOP sets its CLOSE/NOCLOSE option to that of the INFILE.
Example 1
This example stops command processing when invalid packed data is found in the CUST-BALANCE field. Once detected, the record is printed using the layout file that is referenced by ddname LAYOUT, the condition code is set to 8, and the command stops. The record on which the invalid packed data was found is available to any subsequent commands within the particular job step.
PRINT,
  LAYOUTFILE(LAYOUT),
  FORMAT(S),  
  SELRECIF(CUST-BALANCE,NEP),
     SETRC(8),
    STOP(NOCLOSE)   
Example 2
In this example when a C'400' is found for field CUST-REWARD-LEVEL, the record is written to the file referenced by the ddname REC400, and the READ command is immediately terminated. For all other records that do not meet this selection, they are written to the file referenced by ddname OLDRECS. (Usually the action previous to an IF statement ends the previous IF's actions, in this case WRITE(OLDRECS). However, when STOP is used, it ends the subordinate actions to the previous IF/AND/OR.) Any records with a CUST-REWARD-LEVEL of C'500' are written to the file referenced to by REC500.
READ,
  MOVE(CLEAR),
  MOVE(1,0,1),
  IF(CUST-REWARD-LEVEL,EQ,C'400'),
    WRITE(REC400),  
    STOP,   
  WRITE(OLDRECS),
  IF(CUST-REWARD-LEVEL,EQ,C'500),
    WRITE(REC500)   
     
SYNCKEY
Use the SYNCKEY keyword with the COMPARE command to identify positions within the OLD and NEW files that are used to synchronize records. Synchronizing records entails finding the newfile record key that shares the same oldfile key as defined by the SYNCKEY keywords. Matching SYNCKEYs are flagged as either MATCHED or CHANGED. Non-matching SYNCKEY records are flagged as either INSERTED or DELETED. Use SYNCKEY when comparing sequential files or PDS members.
When you specify the NOKEY parameter, the data identified by the SYNCKEY position is used to synchronize records within the old and new files. This is named a non-keyed compare. NOKEY is the default. The print parameter defaults to NOPRINT for this type of compare.
When you specify the ASCENDING or DESCENDING parameter, SYNCKEY is used to identify positions that are considered keys in
ordered
OLD and NEW files. This is named a keyed compare. The files must be sorted in ascending or descending order on the part of the record that is identified by the SYNCKEY keyword. PRINT is the default for a keyed compare.
You can specify multiple SYNCKEY keywords on the COMPARE command. The following rules apply for multiple SYNCKEY keywords:
  • Using multiple SYNCKEY keywords supports using the ASCENDING parameter on one or more SYNCKEY keywords with the DESCENDING parameter on another.
  • When you specify multiple SYNCKEY keywords, the NOKEY parameter cannot be specified when other SYNCKEY keywords contain the ASCENDING or DESCENDING parameter.
  • SYNCKEY keywords are processed in the order they are coded.
Syntax
SYNCKEY(
{old-field-name|oldfile-position,length}[,newfile-position]
[,NOKEY|,ASCENDING|,DESCENDING][,NOPRINT|PRINT])
SYNCKEY
(old-field-name,length{,new-field-name|,newfile-position}
[,NOKEY|,ASCENDING|,DESCENDING][,NOPRINT|PRINT])
Parameters
SYNCKEY supports the following parameters:
  • old-field-name
    Use
    old-field-name
    when referencing a data field that is defined in the record layout. The layout must be available to the job step. For more information about how to make the record layout available, see the keyword LAYOUTFILE.
    Note:
    When this parameter is supplied, the keyword 
    oldfile-position
    and
    length
    , are retrieved from the
    old-field-name
    definition.
  • oldfile-position
    Specifies the starting field
    position in the OLDFILE record to compare. Valid choices are the following:
    • 1 - 32760
      The actual position number
  • length
    Specifies the length of the data to compare. If 0, the SYNCKEY is from the position parameters to the end of the records. Valid values are 0 - 32760.
  • new-field-name
    Use
    new-field-name
    when referencing a data field that is defined in the NEW file record layout. The layout must be available to the job step. For more information about how to make the NEW record layout available, see the keyword LAYOUTFILEN.
  • newfile-position
    Specifies the optional starting position in the NEWFILE record to compare. If this is omitted, the
    oldfile-position
    is used for the
    newfile-postion.
    Valid choices are the following:
    • 1 - 32760
      The actual position number
  • NOKEY
    Specifies a non-keyed compare. The data that are identified by the SYNCKEY positions is used to synchronize records within the old and new files. NOKEY is the default.
  • ASCENDING
    Specifies a keyed compare. The positions that are specified are treated as keys in ascending order to synchronize records.
  • DESCENDING
    Specifies a keyed compare. The positions that are specified are treated as keys in descending order to synchronize records.
  • NOPRINT
    SYNCKEY values are not printed in the COMPARE report. NOPRINT is the default with the NOKEY parameter.
  • PRINT
    SYNCKEY values are printed for each record in the COMPARE report. PRINT is the default when the ASCENDING or DESCENDING parameter is used.
Example 1
This example syntax uses the first five positions of the old file and the positions 20 - 24 of the new files as the SYNCKEY value for the COMPARE command. These bytes are used to synchronize the two files. The POSITION keywords are used to compare only the positions that are defined by them.
COMPARE,
  SYNCKEY(1,5,20),
  POS(6,15,6),
  POS(25,0,25)
The same results can be obtained using the old-field-name parameter. In this case the position of the CUST-KEY must be the same in both the old and new files.
COMPARE ,
  LAYOUTFILE(LAYOUT),
  SYNCKEY(CUST-KEY),
  POS(6,15,6),
  POS(25,0,25)
Example 2
In this example a keyed comparison of the old and new files is performed using the data found in field CUST-KEY of both files as an ascending key, and the data in positions 20 through 22 of the old file with positions 26 through 28 of the newfile as a descending key. The keys are printed for each record in the report.
COMPARE,
  LAYOUTFILE(LAYOUT),
  SYNCKEY(CUST-KEY,ASC,PRINT),
  SYNCKEY(20,03,26,DESC,PRINT)
Example 3
In this example, a descending key comparison of the old and new files is performed. The position for CUST_KEY in the OLD file is found in the copybook that is referenced by LAYOUT. The position for NEW_CUST_KEY in the NEW file is found in the copybook that is referenced by LAYOUTN. The length is determined by CUST_KEY in the OLD file.
COMPARE,
  LAYOUTFILE(LAYOUT),
  LAYOUTFILEN(LAYOUTN),
  SYNCKEY(CUST-KEY,NEW_CUST_KEY,DESC,PRINT)
SYNCLIM
The SYNCLIM keyword controls the number of records to read ahead in the OLD and NEW files while looking for a match. If SYNCLIM is set too low, the compare fails to find the matching record and flags a true match as an INSERT and DELETE. If SYNCLIM is set too high, processing speed suffers. If a match, as defined by the SYNCKEY keyword, is not found within these records, a mismatch, INSERT or DELETE, is declared. You can only use this keyword with the COMPARE command. The shipped default value for SYNCLIM is 50, but this value may have been changed during installation.
Syntax
SYNCLIM(50 | 
number
)
Parameters
SYNCLIM supports the following parameter:
  • number
    An integer value from 0 through 99999. The default value is 50, but this may have been changed during installation.
Example
This example syntax limits the number of input records to search for a match to 100 before flagging the current records as inserted or deleted.
COMPARE,
  SYNCLIM(100)
TRUNCRC
The TRUNCRC keyword sets the command return code if an output record data is truncated and data was written past the allowable record length. The default value is 4, but this may have been changed during installation.
Syntax
TRUNCRC(4 | 
return-code
)
Parameters
TRUNCRC supports the following parameter:
  • return-code
    An integer value from 0 through 4095.
Example
This example syntax returns a condition code of 12 when the input record length is greater than the defined maximum output record length.
COPY,
  TRUNCRC(12)
UNIT
The UNIT keyword identifies which DASD unit name or generic name to select for processing. This keyword is only valid with the DSNINFO and VOLINFO commands.
Syntax
UNIT=([
unitname
][,…])
Parameters
UNIT supports the following parameter:
  • unitname
    Any valid DASD unit or generic name
Example
This example syntax lists all data sets on all DASD with the generic name of 3390.
DSNINFO 
  UNIT(3390)
VOLSER
The VOLSER keyword provides a way for selecting DASD by using its volume serial numbers. This command is only valid with the DSNINFO and VOLINFO commands.
Syntax
VOLSER({
volume-serial-number
 | 
pattern
}[,…])
Parameters
VOLSER supports the following parameters:
  • volume-serial-number
    Any valid DASD volume serial number.
  • pattern
    The volume serial number pattern mask:
    • *
      An asterisk signifies any number of characters starting in this position.
    • %
      A percent sign serves as a placeholder for any character in this specific position.
Example
This example syntax lists volume information for all VOLSERs that begin with PAK9 with the VOLSERs PAK001 and PAK002.
VOLINFO,
  VOLSER(PAK001,PAK002,PAK9*)
WRITE
The WRITE keyword specifies to which output files the move or work buffer is to be written. The output files are referenced by ddnames. The move buffer is created and populated by a series of MOVE keywords. The work buffer is created by the COPY, PRINT, READ and UPDATE commands, and populated with the current input record.
You can specify multiple WRITE keywords per command and multiple output files per WRITE keyword. If the move buffer has not been written from, the WRITE keyword takes its output from there. Once the move buffer has been written, subsequent WRITEs take its output from the work buffer, if, and only if, a new move buffer has not been created and initialized by a subsequent MOVE keyword. Otherwise it again takes its output from the move buffer.
If the move or work buffer is longer than the maximum allowable record length for the output file, the buffer beyond this length is not written, and the command terminates with the value of TRUNCRC, if supplied, otherwise it uses the &BAT_TRUNCRC installed value.
If the move or work buffer is shorter than the minimum allowable record length for the output file, the buffer is increased to this length. These bytes are initialized with the PADCHAR value, if supplied, otherwise it uses the &BAT_PADCHAR installed value.
Syntax
WRITE(
ddname
[,…])
Parameters
WRITE supports the following parameter:
  • ddname
    The one to eight-character ddname of the output file.
Example 1
This example syntax writes the current output buffer to the data set name referenced by ddname CUSTREC.
READ,
  MOVE(CLEAR),
  MOVE(1,0,1),
  WRITE(CUSTREC)
Example 2
This example syntax writes the current move buffer, the CUST-KEY value of the input record, to the data set names referenced by ddnames CUSTREC and NEWCUST, when CUST-TYPE equals 'NEW'. It also copies these matching records in their entirety to the default outfile SYSUT1O.
COPY,
  LAYOUTFILE(LAYOUT),
  SELRECIF(CUST-TYPE,EQ,C'NEW'),
    MOVE(1,CUST-KEY),   
    WRITE(CUSTREC,NEWCUST)  
Example 3
This example syntax writes the current work buffer, the entire input record, to the data set names referenced by ddnames CUSTREC, MSTRREC ,and the default outfile SYSUT1O, when CUST-TYPE is equal to 'NEW'.
COPY,
  LAYOUTFILE(LAYOUT),
  SELRECIF(CUST-TYPE,EQ,C'NEW'),
    WRITE(CUSTREC,MSTRREC)  
Note:
It is possible to generate identical names. Replacing identically named members can be controlled using the REPLACEMEM keyword.