• Rajesh A R

F1 for Mainframe

F1 for Mainframe

Tag Archives: zeroes

SORT – OUTREC – INSERT ZEROES, BLANKS, STRINGS

27 Tuesday Mar 2012

Posted by rajeshar in SORT

≈ 5 Comments

Tags

blanks, insert, mainframe, SORT, strings, zeroes

SORT – OUTREC – INSERT ZEROES, BLANKS, STRINGS

Using OUTREC parameter in SORT, you can insert zeroes, blanks or strings in any place you require of the output record.

  1. Insert Zeroes

    Suppose you want to copy first 10 fields then place 10 zeroes and then bytes from 11 to 20 from the input file to output file. Your OUTREC would look like as below.

    OUTREC FIELDS=(1,10,10Z,11,10)

    Where 10Z means 10 Zeroes

  2. Insert Blanks

    Suppose you want to copy first 10 fields then place 10 blanks and then bytes from 11 to 20 from the input file to output file. Your OUTREC would look like as below.

    OUTREC FIELDS=(1,10,10X,11,10)

    Where 10X means 10 Blanks

    The above OUTREC can also be written as below:

    OUTREC FIELDS=(1,10,21:11,10)

    Where 21: would ask the sort to fill the data from 11 to 20 bytes of input into 21 to 30 of the output dataset. SORT will automatically fill in blanks from 11 to 20.

    Specifying c:X as your last field is an easy way to increase the record length of your output records to c bytes. For example, if you want to create 80-byte output records containing the first 30 bytes of your input records padded with blanks, you can use this OUTREC statement:

    OUTREC BUILD=(1,30,80:X)

  3. Insert string

    To insert character strings use the below format

    OUTREC FIELDS=(1,10,C’AT LAST’)

    Here we are inserting the string ‘AT LAST’ once after copying first 10 chars of input record.

    OUTREC FIELDS=(1,10,5C’AT LAST’)

    Here we are inserting the string ‘AT LAST’ five times after copying first 10 chars of input record.

    To insert hexadecimal strings use the below format

    OUTREC FIELDS=(1,10,X’yy..yy’)

    Here we are inserting the string ‘yy..yy’ once after copying first 10 chars of input record.

    OUTREC FIELDS=(1,10,nX’yy..yy’)

    Here we are inserting the string ‘yy..yy’ five times after copying first 10 chars of input record.

    ——————————————————————————————————–

    In United States, If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog

    ——————————————————————————————————–

    You may also like to look at:

    Working on Mainframes – Is Change to a different technology necessary
    Important SQL CODES and ABEND CODES
    SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
    KNOW YOUR MAINFRAME
    REXX – INITIAL SETUP
    SAS – SAMPLE PROGRAM
    SORT – CONVERT PD to ZD IN DISPLAYABLE FORMAT (ZDF)
    SORT – Alphanumeric Tests for INCLUDE and OMIT
    SORT – EQUALS Option
    SORT – PARSE – REFORMAT VARIABLE FIELDS
    SORT – FINDREP, IFTHEN and INREC
    SORT – JUSTIFY, SQUEEZE and OVERLAY
    SORT – LOOKUP AND CHANGE
    SORT – CONVERT PD to ZD and BI to ZD
    SORT – OUTREC – TRAN
    SORT – OUTREC – INSERT ZEROES, BLANKS, STRINGS
    SORT – OUTPUT DATASET DCB (LRECL,RECFM,BLKSIZE)
    SORT – INCLUDE and OMIT
    SORT – Process Order of CONTROL Statements
    SORT – How to use VB dataset (VLSHRT)
    SORT – EDIT MASK PATTERNS
    SORT – EDIT NUMERIC FIELDS (I,T,S)
    SORT – EDIT FIRST AND LAST RECORD
    SORT – SYMBOLS
    SORT – TO REPLACE A CHAR WITH ANOTHER CHAR – ALTSEQ
    SORT – SET RETURN CODE ‘04’ IF OUTPUT FILE IS EMPTY
    SORT – INREC, INCLUDE and OMIT
    SORT – SKIPREC and STOPAFT
    SORT – INREC
    SORT – SUM FIELDS
    SORT – REMOVE DUPLICATES AND WRITE THEM TO XSUM
    DFSORT – Informational and Error Messages
    SORT JOIN – UNPAIRED RECORDS INDICATOR
    SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
    SORT JOB – SIMPLE COPY
    SORT TIPS

Rate this:

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • November 2020
  • July 2020
  • February 2020
  • January 2020
  • September 2019
  • August 2019
  • October 2018
  • April 2018
  • March 2018
  • December 2017
  • October 2017
  • August 2017
  • July 2017
  • June 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • May 2016
  • March 2016
  • February 2016
  • January 2016
  • May 2015
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • January 2013
  • December 2012
  • November 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • April 2011
  • March 2011
  • August 2009
  • June 2009
  • April 2009

Categories

  • Azure
  • CA7
  • CICS
  • COBOL
    • Keywords
  • DB2
  • EASYTRIEVE
  • FILEAID
  • FILEMAXX
  • IMS
  • ISPF
  • JCL
  • KNOW YOUR MAINFRAME
  • Mainframe Migration
  • MAINFRAMES
  • Others
  • REXX
  • SDSF
  • SORT
  • Training
  • TSQL
  • VSAM

Meta

  • Register
  • Log in

Blog at WordPress.com.

  • Follow Following
    • F1 for Mainframe
    • Join 88 other followers
    • Already have a WordPress.com account? Log in now.
    • F1 for Mainframe
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar