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

How to Enter The Spool Area In Real Time?

7 Answers   IBM,


I HAVE A SEQUENTIAL FILE CONTAINING ONE RECORD IN WHICH I HAVE ONE FIELD AS CUSTOMER IDENTITY NUMBER FIELD WHICH IS A SIGNED FIELD. HOW TO SEQUENTIALLY INCREMENT THIS FIELD USING OVERLAY PARAMETER?.

1 Answers  


what sort card you will use to copy the data from one dataset to another dataset?

0 Answers   IBM,


what will be the error code if duplicate key of VSAM file is found?

1 Answers   HSBC, Kings,


How many steps we can overide in the proc's?

2 Answers   CS,






What are s0c1, s0c4, s0c5, s0c7 and socb?

0 Answers  


What all are the changes to be made in JCL so as to do testing?

2 Answers   TCS,


which parameter is used to check the syntax of a jcl without executing it?

0 Answers   IBM,


Suppose I have a file with three fields with data in the following format 1. empid - S9(4) COMP 2. empname - X(20) 3. empsal - S9(5)V(2) COMP-3 If I view this file, it will not be in a readable format. How to display the empid and empsal fields in a readable format without using COBOL program? What kind of SORT card will have to be coded?

4 Answers  


Explain the function of dd name parameter with a 2 part structure; audit.report?

0 Answers  


can anyone explain me about sort in jcl with inrec and outrec ?

2 Answers   HCL,


I have a cobol db2 program(PGM A) where other program (PGM B) will call this program and passes some 50 fields data to PGM A. PGM A has some layout in which it receives the data from PGM B. And this layout has been copied in the linkage section pf PGM A. After getting the data, PGM A writes the data in a flat file in the same layout which it receives from PGM B. PGM B is a simple COBOL pgm. Please provide a JCL to run these programs.

0 Answers  


Categories