How to get the last but one duplicate record of the file
using Sort?
Answers were Sorted based on User's Feedback
Answer / vikas pujar
Sort Dataset SORTXSUM will hold the duplicate records if in
Sysin dd *, we give option XSUM, after SUM FIELDS=NONE. So
last but one record in dataset should be the answer.
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / anju
//step1 exec pgm=sort
//sortin dd dsn=file1,disp=shr
//sortout dd dsn=file2,disp=(new,catlg,delete),
// unit=disk,space=(cyl(20,10),rlse)
// dcb=(recfm=fb,lrecl=80,blksize=800)
//sortxsum dd dsn=file3,disp=(new,catlg,delete),
// unit=disk,space=(cyl(20,10),rlse)
// dcb=(recfm=fb,lrecl=80,blksize=800)
//sysin dd *
sortfields=none,xsum
/*
//step2 exec pgm=sort
//sortin dd dsn=*.step1.sortxsum
//sortof01 dd dsn=file4,disp=(new,catlg,delete),
// unit=disk,space=(cyl(20,10),rlse)
// dcb=(recfm=fb,lrecl=80,blksize=800)
//sortof02 dd dsn=file5,disp=(new,catlg,delete),
// unit=disk,space=(cyl(20,10),rlse)
// dcb=(recfm=fb,lrecl=80,blksize=800)
sysin dd *
sortfields=copy
outfil files=01,startrec=2,endrec=2
outfil files=02,startrec=3,ENDREC=5
/*
I did not test this. Hope this will work and file4 will give
the last but 1 duplicate record.
| Is This Answer Correct ? | 1 Yes | 2 No |
i want to restart frm step 2, previously i coded cond parameter on step2 wht happens at tht time ?
A statement about PROCs is " In PROCs, Symbolic Parameters can be assigned on PROC and EXEC", BUT On which EXEC, (i) On the JCL's EXEC which is calling to PROC1. (Inside JCL, EXEC PROC1) (ii) or On the PROC's EXEC where it calls the PGM1. (Inside PROC, EXEC PGM=PGM1)
can we write a proc with in a proc
How do you override a specific DDNAME/SYSIN in PROC from a JCL?
what is JCLLIB and PROCLIB in jcl and their syntax
how to run JCL thru COBOL.
how to purge 50 initiators continuously?? console commands??
Given a input file with duplicates how to remove the duplicate records from the file using JCL?
6 Answers CDS, Convergys, TCS,
what are the types of abends that occur on job failure? And explain the possible causes of these
What statement marks the beginning of an in-stream or cataloged procedure in jcl and assigns default values to parameters defined in the procedure?
Which statement is used to identify the private libraries in job?
How to submit jcl through a cobol program?