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

What is the format of comment statement?

0 Answers  


What is the max blocksize for a Tape file?

2 Answers  


I have 20 steps in a job... step01, 02....step17...step20. For some reason I want to execute step17 only if the return code for all the previous steps are less than or equal to 4. otherwise if return code for any of the previous 16 steps is greater than 4, then step17 should be bypassed. How do I do that ?? how and in which step should i formulate COND parameter

8 Answers  


what happens when time=0 is given in jcl code. what happens when blksize=0 is given in jcl code. what is symbolic and overriding parameters and a example program.

6 Answers   HCL,


jcl is like a complier....?

6 Answers  






what are the statements that are not valid to be included in an include statement?

0 Answers   IBM,


What is Cataloged Procedures?

0 Answers  


Suppose i have 2 steps in my pgm. Step1- creates a file, Step2 - generates report from file in step1, What changes have to be made in Step2, so that if the file in Step1 is empty Step2 should not be executed? No changes to be made to Step1.

4 Answers   TCS,


Explain how can values be passed from the job stream to an executable program?

0 Answers  


If the COND parameter is specified in both the JOB and EXEC statements, which one will take precedence? If JOB takes priority and if all the conditions evaluate to false, then will the conditions on the EXEC step be evaluated next?

4 Answers   Wipro,


what is DD statement is used in JCL?

0 Answers  


i have a jcl in which 4 & 5 step creates a new generation. 4th step output is as input for the 6th step & 5th step output is used as input in the 7th step. How they are refered as in the 6th & 7th steps? If the job abends in 6th step then how the 5th step output is refered in 7th step?

1 Answers   IBM,


Categories