Professional Documents
Culture Documents
Summary of DFSORT Control Statements: Describes The Fields For A Sort Application, or Requests A
Summary of DFSORT Control Statements: Describes The Fields For A Sort Application, or Requests A
The
basic
commands
in
both
the
products
are
same.
ICETOOL provides a lot more than what SORT can offer and it comes with
DFSORT
product.
SYNCTOOL
comes
with
SYNCSORT
product.
PGM
SORT
can
point
to
DFSORT.
DFSORT is an IBM product & needs SORTIN (input dataset) SORTOUT
(output Dataset) SYSIN (control card) and SYSOUT (Message dataset).
SORT
Length
of
the
field,
Type,
A/D)
Bi - Binary
ZD Zoned decimal
PD Packed Decimal
FS Floating sign
A ASC
D DESC
MERGE
OPTION
Overrides installation
features or a copy application.
defaults,
or
requests
optional
If you know you have VB records with short control fields, you can
specify the VLSHRT option, if appropriate, to prevent DFSORT from
terminating.
For example:
OPTION VLSHRT
SORT FIELDS=(21,12,CH,A)
With DFSORT you can copy data sets directly without performing a sort
or merge.
You can use COPY with all of the other DFSORT control statements
except SUM.
DFSORT can select and reformat the specific data sets you want to copy
by using the control statements covered in later chapters. You write a
copy statement by specifying COPY on the SORT, MERGE, or OPTION
statement.
For example:
SORT FIELDS=COPY
MERGE FIELDS=COPY
Or
OPTION COPY
INCLUDE
OMIT
SUM
On the SUM control statement, you specify one or more numeric fields
that are to be summed whenever records have equally collating control
fields (control fields are specified on the SORT statement).
INCLUDE COND=(110,5,CH,EQ,C'ENGL')
SORT FIELDS=(110,5,CH,A)
SUM FIELDS=(170,4,BI)
To remove duplicate records we can specify NONE
SORT FIELDS=(106,4,CH,A)
SUM FIELDS=NONE
SUM
the
The
the
OUTREC
*
*
*
*
Doing Change
OUTREC FIELDS=(110,5,CHANGE=(16,C'HIST',C'History',
C'BUSIN',C'Business',C'COMP',C'Computer Science',
C'ENGL',C'English',C'BIOL',C'Biology',
C'PSYCH',C'Psychology'),NOMATCH=(C'Unaffiliated'),
C' | ',106,4,CHANGE=(20,
C'FERN',C'Fernall Brothers',C'COR',C'Cornish Limited',
C'VALD',C'Valdern and Co.',C'WETH',C'Wethman, Inc.'))
(+n
DIV
and
the
OUTREC FIELDS=(1,30,JFY=(SHIFT=LEFT))
SHIFT=LEFT indicates that you want to left-justify.
DFSORTs justify feature also lets you add a leading string, a
trailing string, or both, to the data. For example, you can use the
following statements to surround the left-justified data with < and
>:
OPTION COPY
OUTREC FIELDS=(1,30,JFY=(SHIFT=LEFT,LEAD=C'<',TRAIL=C'>'))
If you only want to change one or a few items and keep the rest of the
record in its original form, theres an easier way: the OVERLAY
parameter of the OUTREC statement
OPTION COPY
OUTREC FINDREP=(IN=C'Goodbye',OUT=C'Bye')
FINDREP indicates that you want to do a find and replace operation. IN
identifies the constant you are looking for (the find constant) and
OUT identifies the constant you want instead (the replace constant).
OPTION COPY
OUTREC FINDREP=(INOUT=(C'William',C'Bill',
C'Mike',C'Michael',C'Dog',C'Beagle',C'*',C'#'))
INOUT identifies pairs of find and replace constants.
IFTHEN
OPTION COPY
OUTREC IFTHEN=(WHEN=INIT,
BUILD=(1:1,40,50:106,4,60:170,4,BI,EDIT=(TT.TT),70:170,4)),
IFTHEN=(WHEN=(50,4,CH,EQ,C'COR',AND,70,4,BI,GT,+2000),
OVERLAY=(70:C'20%',X)),
IFTHEN=(WHEN=(50,4,CH,EQ,C'COR',AND,70,4,BI,LE,+2000),
OVERLAY=(70:C'10%',X)),
IFTHEN=(WHEN=(50,4,CH,EQ,C'VALD'),OVERLAY=(70:C'25%',X)),
IFTHEN=(WHEN=NONE,OVERLAY=(70:C'15%',X))
INREC
OUTFIL