Splits or merges records (RESIZE Operator)


RESIZE operator creates a larger record from multiple shorter records if the input length is smaller than the coded length. It also creates multiple shorter records from larger ones if the input length is greater than the coded length. It produces fixed-length output records based on the coded length from fixed-length input records.

Syntax -

RESIZE Operator

Required Operands


  • FROM - specifies ddname of the input file. It is mandatory when FROM operand is coded.
  • TO - specifies 1 to 10 ddnames of output files. TO and USING operands can code at the same time.
  • TOLEN - Specifies the record length uses for the resized output records. 'n' can be 1 to 32760.

Optional Operands


  • USING - specifies the first 4-characters of the ddname (xxxxCNTL) for the DFSORT control statement. XXXX name is the user-defined name. Either TO, USING, or both operands can code at the same time.

Example -


Scenario - Resize the employees record length from 80 to 49.

INPUT - MATEPK.INPUT.PSFILE

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
001  PAWAN         MAINFRAME           JPM       AP        IN
002  SRINIVAS      TESTING             ORACLE    TG        IN
003  SRIDHAR       SAS                 CG        OR        US
004  VENKATESH     ABAP                CSC       CA        US
005  RAVI          HADOOP              CTS       FL        US
006  PRASAD        HR                  INFOSYS   MI        US
007  RAJA          TESTING             IBM       CA        US

JCL -

----+----1----+----2----+----3----+----4----+----5----+
...
//STEP01   EXEC PGM=ICETOOL
//INDD     DD DSN=MATEPK.INPUT.PSFILE,DISP=SHR
//OUTDD    DD DSN=MATEPK.OUTPUT.PSFILER,
//            DISP=(NEW,CATLG,DELETE),VOLUME=SER=DEVHD4,
//            SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,
//            DCB=(DSORG=PS,RECFM=FB,LRECL=49,BLKSIZE=490)
//TOOLIN   DD *
  RESIZE FROM(INDD) TO(OUTDD) TOLEN(49)
/*
...

OUTPUT - MATEPK.OUTPUT.PSFILER

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
001  PAWAN         MAINFRAME           JPM                                      
AP        IN
002  SRINIVAS      TESTING             ORACLE                                   
TG        IN
003  SRIDHAR       SAS                 CG                                       
OR        US
004  VENKATESH     ABAP                CSC                                      
CA        IN
005  RAVI          HADOOP              CTS                                      
FL        US
006  PRASAD        HR                  INFOSYS                                  
MI        US
007  RAJA          TESTING             IBM                                      
CA        US