i have a file which contains duplicates ? my requirement is to
eliminate duplicates and these elminated duplicates should be
moved to another file can any code this using sort ?

Answers were Sorted based on User's Feedback



i have a file which contains duplicates ? my requirement is to eliminate duplicates and these elmin..

Answer / prabudha jain

//SORTXSUM DD DSN=datasetname,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(1,4),RLSE),
// DCB=(RECFM=FBM,LERCL=80,BLKSIZE=800)
.
.
//SYSIN DD *
SORT FIELDS=(1,3,CH,A)
SUM FIELDS=NONE,XSUM
/*

1. SORT FIELDS=(1,3,CH,A) - Input file will be sorted
depending upon the key specified above 1,3,CH,A.

2. SUM FIELDS=NONE,XSUM - NONE means it will eliminate
duplicates.XSUM option will copy all records eliminated in
sort process will copy to another dataset defined in
SORTXSUM stelp

Is This Answer Correct ?    12 Yes 1 No

i have a file which contains duplicates ? my requirement is to eliminate duplicates and these elmin..

Answer / vinay sonar

Please refer mainframe refresher by MUTTU

Is This Answer Correct ?    1 Yes 0 No

i have a file which contains duplicates ? my requirement is to eliminate duplicates and these elmin..

Answer / snehatechm

But which duplicate record will be found in SORTXSUM.
Will it have last duplicate record or first duplicate
record.

e,g 123acvvbbnm
123bbbbbbbb
123rkrjrjjr

which record will be found in sortxsum

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JCL Interview Questions

We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?

0 Answers   IBM,


What is GDG and what is the maximum limit of versions that can be created?

9 Answers   Convergys,


How to exclude the duplicate records from two concateded flat files (records from both files must be removed)?

1 Answers  


In my job I have 6 steps. Step01,02,03...step06. after executing step02 i want to skip step03 and want to execute step04. and once step04 is done then I want to go back and execute step03. once step03 is completed I want execute step05, 06 and so on... can any one tell me how do i do that???

10 Answers   Perot Systems,


How can a stopped job be started again?

0 Answers  






List the different jcl statements that are not permitted in the procedures?

0 Answers  


In order to continue a job after a return code of 12 in step1, what the step2 exec statement include?

1 Answers  


how can a gdg base be created in a jcl. What is the difference between empty and scratch parameter while defining/altering gdg base?

0 Answers   IBM,


what r the types of job control statements?

2 Answers  


write a jcl to execute a job by 7:00 am on jan 20,1986?

0 Answers   IBM,


How do you check the syntax of a JCL without running it?

17 Answers  


What are some jcl statements that are not allowed in procedures?

0 Answers  


Categories