How to find the number of duplicates in a file using Sort?
Answers were Sorted based on User's Feedback
Answer / abhijit saha
Hope this JCL explains your query
//COUNTDUP JOB ,'COUNT DUPLICT',
// MSGCLASS=Q,CLASS=D,
// NOTIFY=&SYSUID
//STEP010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=ABCXYZ.UTIL.TEST,DISP=SHR
//RPT DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(IN) LIST(RPT) NOHEADER BLANK -
ON(1,2,CH) ON(VALCNT,U04)
/*
INPUT: ABCXYZ.UTIL.TEST
AB
AB
AB
DC
DC
PQ
PQ
Output:
AB 3
DC 2
PQ 2
Is This Answer Correct ? | 17 Yes | 10 No |
Answer / prachi
In order to copy eliminated duplicates into another file
using sort is as below:
//SORTXSUM DD DSN=----
:
:
:
:
//SYSIN DD *
SORT FIELDS = copy
SUM FIELDS =NONE,XSUM
/*
//
Is This Answer Correct ? | 7 Yes | 4 No |
Answer / divya reddy
we can sort it simply by using a command called" DF-sort"
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sudha
//
//
//
//sysin dd *
sort fields=(1,4,ch,a)
sum fields=none/all
/*
for avoiding duplicates
Is This Answer Correct ? | 1 Yes | 2 No |
how do you code a null statement?
Suppose i have a file with 10 recs and i want to skip only the 7 th record and copy the rest into another file. How do i do it using SORT?
Explain how can the attributes of one sms dataset be copied to another dataset?
Suppose I have Five Steps in PROC In this Case I want to Execute third Step in PROC using Main JCL don't use any COND Explain with Coding Thanks & Regards SHREE
What is the difference b/w the CLASS,TIME,PRTY in jcl job card.
what is the purpose of SYSOUT parameter in the DD statement?
The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The DISP in the JCL is SHR and the program opens the file in EXTEND mode. What happens ?
Suppose I have seven jobs to do, but I want to hold one than how can I do this?
Can you code instream data in a PROC ?
Hi, can we call catalog( say myproc } proc n times in jcl if so how please explain Thanks in advance
how to write a jcl prog to copy alternate recs from ps1 to another ps2,suppose ps1 having 10 recs?
how to identify the file used in the JCL is an VSAM file. Just seeing the JCL code how can we track the file as VSAM file?