How to get the last but one duplicate record of the file
using Sort?

Answers were Sorted based on User's Feedback



How to get the last but one duplicate record of the file using Sort?..

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

How to get the last but one duplicate record of the file using Sort?..

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

Post New Answer

More JCL Interview Questions

IN-STREAM DATA NOT ALLOWED IN PROC how can come out from this problem

7 Answers  


IIN APITUDE THEY GAVE ONLY 10 QUESTIONS.. THEY ARE SIMPLE ONE FROM NUMBER SERIES,BOATS,TIME & DISTANCE,PROFIT &LOSS,FIND OUT THE NUMBER ? 9 25 4 36 81 64 49 AND surveillance SPELLINGS E.T.C

0 Answers  


ihave ten flatfile in that iwant to concatinate all the files except file 5,6 into output file by uing jcl? how to do this? give me detail yntax for tis?

4 Answers   IBM,


what happens in conversion stage in job processing?

0 Answers   IBM,


What you mean by skeleton JCl?

2 Answers  






What are the common jcl syntax errors you get? This is not abends?

1 Answers  


Hi, Say I have 10 flat files and I want to copy all these 10 flat files to a GDG versions flat files (I have GDG base: FDWS01.TEST.RESTORE) in one shot. Can we do that in one shot using a JCL. May be by using IEBGENER. It's a bit urgent. So anyone's fast rely would be appreciated.. Thanks in advance.. 10 flat files ----------------------------------- FDWS01.SUB.RESTORE1 FDWS01.SUB.RESTORE2 FDWS01.SUB.RESTORE3 ; ; FDWS01.SUB.RESTORE10 TO GDG versions ----------------------- FDWS01.TEST.RESTORE.G0001V00 FDWS01.TEST.RESTORE.G0002V00 FDWS01.TEST.RESTORE.G0003V00 ; ; FDWS01.TEST.RESTORE.G0010V00

4 Answers  


what are the ways of passing data to a cobol program from jcl?

1 Answers   IBM,


How do you create a temporary dataset? Where will you use them?

2 Answers   IBM,


wht do u mean by inrec and outrec ?

1 Answers   IBM,


wht is sysudump n sysout,sysprint ?

1 Answers   L&T,


There are 5 steps in a Job. How to bypass the first step by making use of only COND Parameter and not using any Restart and IF/THEN/ELSE parameter?

11 Answers   IBM,


Categories