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 do we mean by 'Virtual storage' for a dataset and for a JOBSTEP ? What is the significance of the following statement for a programmer 'Virtual storage results in program addresses being independent of the addresses that actually exist in a computer' ?

1810


by using cond parameter maximum 8 cond can be coded in single cond means ?explain

1243


Matching Logic in Jcl not in cobol.Could any one please answer this question

3948


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

4604


In sms datasets, what is the function of the dd avgrec keyword?

885


Explain the purpose of dd dummy statement?

940


When space is allocated for an output dataset, what units can be used?

1022


Is there any command to check wether the ps file is in sorted order?

2671


I want to join to input files and write the matching fields on to an output file but i dont want the output file a sorted one

2168


how to compare two datasets without using superce because output is limited to 133 bytes

1843


What is multithreading in jcl?

1216


How to submit jcl through a cobol program?

925


what is the difference between JES3 and JES2?

925


In sms datasets, what is the function of the dd mgmtclas keyword?

1163


what are the various stages of job processing?

1046