I have 3 duplicate records in a file .
I want to eliminate 1st, 2nd and copy 3rd one only . HOW ?

Answers were Sorted based on User's Feedback



I have 3 duplicate records in a file . I want to eliminate 1st, 2nd and copy 3rd one only . HOW ?..

Answer / vignesh1988i

so , first sort the PS using JCL SORT utility and update the
PS file.
find the duplicates using XSUM . and write the duplicates
alone in a seperate PS.
take the seperate PS and give the control condition inside
SYSIN DD * as , sort fields with skiprec(3), since u need
only the 3rd one to copy

Is This Answer Correct ?    16 Yes 2 No

I have 3 duplicate records in a file . I want to eliminate 1st, 2nd and copy 3rd one only . HOW ?..

Answer / abhaytronics

use 'sumfields'

Is This Answer Correct ?    13 Yes 4 No

I have 3 duplicate records in a file . I want to eliminate 1st, 2nd and copy 3rd one only . HOW ?..

Answer / vivek chandrasekaran

:
Use ICETOOL to solve the request in 1 step

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(p,l,t) LASTDUP
/*

Where p - position, l - length, t-type(CH,PD..)

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More JCL Interview Questions

I HAVE A VB BLOCK WHICH IS USED AS INPUT IN COBOL CONATINING SOME RECORDS CAN I CHANGE THE FILE FROM VB TO FB?

0 Answers  


can we bowse or edit the GDG dataset if it is a tape entry?

4 Answers  


How does -818 sql error occur? Why does it happen and what can be done to overcome this error code?

5 Answers   RBS,


What do you feel makes a good program?

1 Answers  


is there any utility for restarting a particular step in jcl reply soon ?

5 Answers  






What is JOBLIB ?

5 Answers   Xansa,


What are three parameters you can specify on Job statement as well as on exec stmt ?

1 Answers  


after submiting the jcl.how do you know that the job has been completed.

4 Answers   ACS,


How do you override a parameter in Positional parameters?

4 Answers   Thomson Reuters,


As PARM can supply information to a program ? Can PARM be used to supply information to a cataloged or Inline Procedure also ?

2 Answers   IBM, RS Software,


HOW TO CONVERT VARIABLE BLOCK TO FIXED BLOCK ?

1 Answers   IBM,


What is use of restart and how to use it?

0 Answers  


Categories