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

Step 1 RC 4 Step 2 Step 3 I want to know the COND parameter which can be coded in step 2 or 3. Step 2 should be executed based on Step 1 RC and Step 3 should not be executed based on step 1's RC

203


What does a disposition of (MOD,DELETE,DELETE) mean ?

651


how do you create a dataset in a jcl with the same file organisation as that of another existing dataset?

782


which utility is used to run a cobol-db2 program?

789


For what purpose steplib and joblib are used ?

667






Explain how can values be passed from the job stream to an executable program?

601


What is jcl in mainframe?

668


a dd statement has 2 types of parameters. Name them?

626


List in order the hierarchical levels of jcl?

652


Can anybody tell what is tool used to generate the list of PROCS used in JCL to generate a PROCTREE

1953


I need exexution process for JCL programs

1828


A chkpt is the parameter coded for multi-volume qsam datasets in a dd statement. When a chkpt is coded as chkpt=eov, a checkpoint is written to the dataset specified in the sysckeov statement at the end of each volume of the input/output multi-volume dataset. State whether true or false?

717


What is multithreading in jcl?

917


what is DSN parameter and DISP parameter is used for?

662


What is the purpose of dd?

705