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()
Push in sort jcl
Reformat fields in sort jcl example.
F1 for Mainframe
SORT – FINDREP, IFTHEN and INREC
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’)
FINDREP | is used to find and replace the input record |
IN | Tells the field that needs to be found |
OUT | Tells the field that needs to be replaced with |
INOUT | Specifies both find and replace strings in order |
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