LABELS Statement


The LABELS statement is used to decide whether the labels are to copied or not to the output file. It is used when -

  • no user labels are to be copied.
  • user labels are to be copied from the SYSIN control card.
  • user labels are to be copied after the user's label processing routines modify them.

Syntax -

//SYSIN DD *
  LABELS [DATA={YES|NO|ALL|ONLY|INPUT}]
/*

Parameters -

KeywordDescription
DATA=YESSpecifies any user labels are treated as data. YES is the default.
DATA=NOSpecifies user labels are not treated as data.
DATA=ALLSpecifies that all user labels in the current processing group are treated as data.
DATA=ONLYSpecifies only user header labels are treated as data.
DATA=INPUTSpecifies user labels for the output file are coded as 80-byte input records in the data portion of SYSIN.

Practical Example -


Scenario - Edit and copy a sequential input data set with labels.

Input PS File - MATEPK.IEBGENER.INPUTPS1

JCL -

----+----1----+----2----+----3----+----4----+----5----+
...
//STEP10   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBGENER.INPUTPS1,DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBGENER.OUTPUTL,
//            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)
    LABELS DATA=INPUT
    RECORD LABELS=3
    .A .B .C
    RECORD LABELS=2
    .D .E
/*
...