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
What methodology can be adapted to transfer data to a program that is coded using the exec statement?
What is the difference between run mode and addressing mode?
What is the function of //cntl statement?
What is the purpose of the dd keylen parameter?
How to read and write a single record into a file. I would like to use it to enter a single 8-character piece of information and use it to put it into a variable for processing in JCL. Thank you
What is concatenating?
Is it possible to left uncode disp?
What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?
Are there any set of rules for the names of the steps used in a job?
Which statement is used to identify the private libraries in job?
In sms datasets, what is the function of the dd mgmtclas keyword?
Explain how can an in-stream dataset be terminated?
How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length ----TRY
What are the 2 types of parameters in dd statement?
When output dataset space is required, what quantity categories are used?