When=group in sort jcl examples

    when init in sort
    when init in sort jcl
    init.d service status
    what is the difference between sort() and sorted()
  • When init in sort
  • Push in sort jcl

  • Outrec ifthen multiple conditions
  • Reformat fields in sort jcl example
  • Build in sort jcl
  • Ifthen in sort jcl examples
  • Reformat fields in sort jcl example.

    F1 for Mainframe

    SORT – FINDREP, IFTHEN and INREC

    1. FINDREP

      Using SORT, you can FIND a value and REPLACE it with another value.

    Suppose you have your input file as below:

    RAJESH TML

    RAMS TML

    SUNIL TML

    SURESH TML

    And you want your output file in this format

    RAJESH TPT

    RAMS TPT

    SUNIL TPT

    SURESH TPT

    Your SORT card would look like below:

    OPTION COPY

    OUTREC FINDREP=(IN=C’TML’,OUT=C’TPT’)

    Or

    OPTION COPY

    OUTREC FINDREP=(INOUT=(C’TML’,C’TPT’)

    FINDREPis used to find and replace the input record
    INTells the field that needs to be found
    OUTTells the field that needs to be replaced with
    INOUTSpecifies both find and replace strings in order
    1. IFTHEN

      You can use five types of IFTHEN clauses as follows:

      WHEN=INIT: Use one or more WHEN=INIT clauses to apply BUILD, FINDREP or OVERLAY items to all of your input records.

      WHEN=GROUP: Use one or more WHEN=GROUP clauses to propagate fields, identifiers and sequence numbers within groups of records.

      WHEN=(logexp): Use

        when=init sort
        init order