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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the function of //cntl statement?

625


a set statement is used to define commonly used symbolic across job steps or procedures. It initializes the previous values in the symbolic names. It has to be defined before the first use of the symbolic names in the jcl. State whether true or false?

592


I want to join to input files and write the matching fields on to an output file but i dont want the output file a sorted one

1897


how do you create a dataset in a jcl with the same file organisation as that of another existing dataset?

768


What does it mean by Restart and Checkpoint in JCL ? How are checkpoints being taken and what is their usage ? How to use Checkpoint macro on a JOBSTEP ?

9178






What is the function of //cntl statement?

803


We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?

1745


How is a type of file defined in the jcl that executes the cobol program?

689


Describe the various parameters utilized in the creation of a gdg?

656


Explain the jcl exec statement?

622


what is DD statement is used in JCL?

653


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

669


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

697


Explain how can the submitting users racf authority be overridden in a job stream?

652


What is use of restart and how to use it?

738