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 JCL with 10 steps, want to execute first 5 steps only, what are ways of doing it?is it possible to control through JOB card?

10 Answers   iGate,


what is force complete

2 Answers   IBM,


What methodology can be adapted to transfer data to a program that is coded using the exec statement?

0 Answers  


How do you skip a particular step in a proc/JOB?

5 Answers   CSC, CTS,


what is the purpose of coding class parameter in job statement?

0 Answers   IBM,






What is the difference between specifying DISP=OLD and DISP=SHR for a dataset?

2 Answers  


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

1 Answers  


When will we need to specify Space parameter ?

3 Answers   Wipro,


What does a disposition of (NEW,CATLG,DELETE) mean?

3 Answers  


Explain how can a jobs execution priority be modified?

0 Answers  


what is JCLLIB and PROCLIB in jcl and their syntax

3 Answers   IBM,


One dataset is creating in the step1 with LRECL of 133 and the same dataset is used in the next step in DISP=SHR mode, but while scanning the JCL the following error is thrwon. Please verify the below JCL $/SEPP030.PROVIDER DD DSN=Z1225BT.F5750PG9.F5910PRV.QC#A6868 //ERRORRPT DD DSN=F5910&ST&IN..F5910EPP.ERRORRPT.P&CYCDATE, --ERRORRPT DD DSN=F5910PG.F5910EPP.ERRORRPT.P, // DISP=&DISNCD,UNIT=&DELQ, -- DISP= (NEW,CATLG,DELETE),UNIT=DELQ, // SPACE=(TRK, (30,15),RLSE), // DCB=&DCB2 -- DCB= (PPG.METMODEL,BLKSIZE=0,LRECL=133,RECFM=FB) $/SEPP030.ERRORRPT DD DSN=Z1225BT.F5910EPP.ERRORRPT.AOUTPUT //SEPP040 EXEC PGM=FILEAID,COND= (0002,EQ,SEPP030) //SYSPRINT DD SYSOUT=* //SYSLIST DD SYSOUT=* //DD01 DD DSN=SYSCMN.PROD.CCLIB (F5910EP1),DISP=SHR $/SEPP040.DD01 DD DSN=Z1225BT.TEST.CCLIB (F5910EP1) E1 - DSS20791E - DATA SET 'Z1225BT.F5910EPP.ERRORRPT.AOUTPUT' HAS AN LRECL OF 133 COULD NOT BE OPENED BECAUSE THE CODED LRECL WAS 80. // DD DSN=F5910&ST&IN..F5910EPP.ERRORRPT.P&CYCDATE, -- DD DSN=F5910PG.F5910EPP.ERRORRPT.P, // DISP=SHR $/ DD DSN=Z1225BT.F5910EPP.ERRORRPT.AOUTPUT please find the error code in the above mentioned lines and please suggest me about the error and the solution for that.

3 Answers   Cognizant,


Categories