What is SORT ? How do we eliminate duplicate records ? How
do I select some records using SORT ?

Answer Posted / anoopkumarg

SORT is a utility(The program name maybe SYNCSORT or DFSORT)
that IBM provides which can do so many useful operations on
a flat file..like sorting the file based on a particular
condition, eliminate duplicates, extract some selective
fields into another file in the required order and the list
goes on..
To eliminate duplicates, we can use as below..
.
.
//SYSIN DD *
SORT FIELDS=COPY
SUM FIELDS=NONE
END

You can use "include condition" along with "sort fields" to
select desired records..the code goes like this..
.
.
//SYSIN DD *
SORT FIELDS=(<give sort condition here>)
INCLUDE COND=(<give the required condition here>)
END

In these cases, the SORT utility accepts one or more input
files and produces an output file which will contain the
desired records..

The IBM standard syntax of the sort command is given below..

SORT FIELDS=({begcol},{length},{fieldtype},{D|A}[,{begcol},
{length},{fieldtype},{D|A}]...)

INCLUDE COND=({begcol1},{length1},{fldtype1},{comp.oper},
{begcol2},{length2},{fldtype2})

Hope you got something from this explanation..

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the parameter we cannot use in procedure? How many instream we can write in single jcl?

586


What is the format of comment statement?

673


What are hierarchy levels in jcl?

960


Name the parameters which can be used to limit the number of records written to a sysout dataset?

658


what sort card you will use to copy the data from one dataset to another dataset?

734






what is SOC4 error?

740


Brief description of inline procedure of jcl.

687


in ways data can be passed to a COBOL program from JCL?

669


What is the purpose of dd dummy statement?

947


how can the same proc be re-used and called by many jobs?

915


Differentiate between the joblib and the steplib statements?

860


What is the purpose of disp parameter?

647


What is the function of the steplib dd statement?

744


What is the purpose of dd * statement in jcl?

814


Explain how can the attributes of one sms dataset be copied to another dataset?

707