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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / prashanth

---sort is a sorting of records either in asc/ des order,
---sort field(6,10,ch,ASC) or sort field(6,10,ch,ASC),equal
sum field none
---sort field(6,10,ch,Asc) 6 is the starting position
10 record length
ch for alpnum (X)
asc order of sorting

Is This Answer Correct ?    14 Yes 6 No

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

Answer / sanjeeva reddy

Sort: Sort utility is used to sort the data in particular order(Ascending or Descending order).

Eliminate Duplicate Records:
----------------------------
//SYSIN DD *
SORT FIELDS=COPY
SUM FIELDS=NONE
/*
Select Some Records:
--------------------
You can use "INCLUDE CODITION" along with "SORT FIELDS" to
select desired records.The code goes like this......

//SYSIN DD *
SORT FIELDS=(<Give The Sort Condition Here>)
INCLUDE COND=(<Give The Required Condition Here>)
/*

Is This Answer Correct ?    1 Yes 1 No

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

Answer / dhan

DFSORT is one of the IBM product. It is a program you use to sort,
merge, and copy the data from one file to another file.

https://youtu.be/IPDyz2xl7Tk
https://youtu.be/9311_rE9LE8
https://youtu.be/HFT9wXtoo74

Is This Answer Correct ?    0 Yes 0 No

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

Answer / chudir vai

yes I appreciate Banchod. I also want to add another
information. Sort is also a khanki. You should always
it

Is This Answer Correct ?    1 Yes 2 No

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

Answer / guest

sort is used to sort the data in asending or diseding order.
by using sort we can copy data from one file to another
file. by using some fields=none

Is This Answer Correct ?    4 Yes 6 No

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

Answer / banchod

sort is nothing bt a big bal. it is used to burn others
bara. it is also the substance to hide ones gud.

Is This Answer Correct ?    1 Yes 3 No

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

Answer / amruta

we can select by using BY variables

Is This Answer Correct ?    0 Yes 4 No

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

Answer / jagan

# 1 ---sort is a sorting of records either in asc/ des
order,
---sort field(6,10,A,CH) or sort field(6,10,A,CH),equal
sum field none
---sort field(6,10,A,CH) 6 is the starting position
10 record length
ch for alpnum (X)
A order of sorting

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More JCL Interview Questions

Mention the types of job control statements?

0 Answers  


Explain the job statement in jcl?

0 Answers  


I have one GDG. Everyday One new version is being created.Now I want to split this created version in different files each having 1000 records. Here Problem is I don't know How many records will be there in new version of GDG? that's why I don't know How many Out files we need to use . Interesting??????????????

4 Answers   CTS,


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

0 Answers  


How to create delta file using JCL

1 Answers   CTC,






Are there any set of rules for the names of the steps used in a job?

0 Answers  


how to convert a file form fixed Length to variable length?

2 Answers   Syntel,


When a dataset is UNCATALOGED in a JOBSTEP, how to get its UNIT and VOL in JCL to refer in subsequent steps ?

1 Answers   IBM,


consider the following progrm statements MOVE 0 TO SW.NO.OF.REC PERFORM PRI-OUT UNTIL SW=1 DISPALY NO.OF.REC STOP RUN PRE-OUT READ IN-FILE AT END MOVE 1 TO SW WRITE OUO-REC FROM IN-REC ADD 1 TO NO.OF REC if the IN-FILE contains 1000 records what value will be displayed after the PERFORM is over? assume that N0.OF.REC has PIC 9(4) a.1000 b.1001 c.1 d.none of the above

1 Answers  


Can you delete the GDG base without deleting GDG generations ?

7 Answers   Cap Gemini,


AM HAVING A FILE WHICH CONTAIN 12 DATS OUT OF WHICH 4 ARE DUPLICATES HOW TO REMOVE THE DUPLICATE FILES IN JCL? CAN I GET THE PROGRAM FOR THIS

3 Answers  


Could anyone please suggest me what is the maximum length of data that can be pass as input in //sysin dd * This was asked in interview. TIA

3 Answers   VC, Wipro,


Categories