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
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 |
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 |
How to Enter The Spool Area In Real Time?
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?.
what sort card you will use to copy the data from one dataset to another dataset?
what will be the error code if duplicate key of VSAM file is found?
How many steps we can overide in the proc's?
What are s0c1, s0c4, s0c5, s0c7 and socb?
What all are the changes to be made in JCL so as to do testing?
which parameter is used to check the syntax of a jcl without executing it?
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?
Explain the function of dd name parameter with a 2 part structure; audit.report?
can anyone explain me about sort in jcl with inrec and outrec ?
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.