RECORD Statement


The RECORD statement defines a record group with editing information. A record group consists of records that are to be processed identically.

Syntax -

//SYSIN DD *
  RECORD [{IDENT|IDENTG}=(length,'name',input-location)]
  [,FIELD=([length],[{input-location|'literal'}],
          [conversion],[output-location])]
  [,FIELD=...][,LABELS=n]
/*

Parameters -

KeywordDescription
IDENT|IDENTG}= (length,'name',
input-location)
Identifies the last record of input file from group of records.
  • length - Specifies the length of field name and it should not be greater than 8.
  • 'name' - Specifies the literal used to identify the last input record from the group.
  • input-location - Specifies the field starting position.
FIELD=([length], [{input-location| 'literal'}], [conversion], [output-location]) Specifies field processing and editing information.
  • length - Specifies the input field or literal length (in bytes) that is to be processed. If it is not coded, length is assumed as 80.
  • input-location - specifies the field starting position. The default value is 1 if it is not coded.
  • 'literal' - Specifies a literal (max length is 40 bytes) that is to be placed in the coded output location.
  • conversion - Specifies a type of conversion (code) that is to be performed on the field.
  • output-location - Specifies the field starting position in the output records. If it is not coded, default value is 1.
LABELS=nis an optional parameter that specifies the number of records in the SYSIN data set to be treated as user labels.

Practical Example -


Scenario - Add literals to the records of the PS file.

Input PS File - MATEPK.IEBGENER.INPUTPS

JCL -

----+----1----+----2----+----3----+----4----+----5----+
...
//STEP10   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBGENER.INPUTPS,DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBGENER.OUTPUTPS,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,10),RLSE),
//            UNIT=3390,VOL=SER=DEVHD4,
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN    DD  *
  GENERATE MAXFLDS=3,MAXLITS=10
    RECORD FIELD=(5,'+++++',,1),
           FIELD=(70,1,,6),
           FIELD=(5,'+++++',,76)
/*
...