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 |
Suppose I have a program in cobol name ”careerride” and want to execute the program by jcl. Specify the process?
Explain about ISPFTTRC
Explain about Cobol Subroutines
what is the function of iebcompr?....is it compare record length or characteristics of a dataset?...pls explain with examples.......
Can we give two user name in NOTIFY parameter in JOBCARD
How to copy one PS file to multiple PS files with same data?
i have 10steps and i want run step3 and based on step3 i want execute step7,8,9,10?in jcl
FOR a GDG, the book by 'SABA ZAMEER' says 'We can NOT ALTER the LIMIT parameter after it is defined'. (p-211). But many persons have written that it can be changed, which one is true ?
i have a jcl in which 4 & 5 step creates a new generation. 4th step output is as input for the 6th step & 5th step output is used as input in the 7th step. How they are refered as in the 6th & 7th steps? If the job abends in 6th step then how the 5th step output is refered in 7th step?
What is Uncatalog dataset? How can we access/use them?
how can handle the s0c4 abend???
what is the default region size if I dont specify region parametre in my job card ( I know that if I specify region=0k or 0M, then the job will occupy all he available resources at the time of job execution), but I want to know the defult value for "region" paramatre.