View previous topic :: View next topic
|
Author |
Message |
UnicornMaster
New User
Joined: 11 Mar 2021 Posts: 8 Location: Canada
|
|
|
|
Hi guys,
I want to count the number of duplicates in a file and return an RC code
If there is duplicates the COUNT return RC8
Examples :
RC8 example
Code: |
//PROC001 EXEC PGM=ICETOOL
//*
//IN DD *
5
7
5
//*
//TOOLIN DD *
COUNT FROM(IN) NOTEQUAL(0) RC8 USING(CTL1)
/*
//CTL1CNTL DD *
//* dfsort that return one line or two lines (if its easier) because there is two 5 in the file
/*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
|
RC0 example
Code: |
//PROC001 EXEC PGM=ICETOOL
//*
//IN DD *
5
7
9
//*
//TOOLIN DD *
COUNT FROM(IN) NOTEQUAL(0) RC8 USING(CTL1)
/*
//CTL1CNTL DD *
//* dfsort that return zero lines because there is no duplicates in the file
/*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
|
|
|
Back to top |
|
|
UnicornMaster
New User
Joined: 11 Mar 2021 Posts: 8 Location: Canada
|
|
|
|
I have think about something like that but it doesn't work because there is no OUT file
Code: |
//PROC001 EXEC PGM=ICETOOL
//*
//IN DD *
5
7
5
//*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,1,CH) ALLDUPS USING(CTL1)
COUNT FROM(OUT) NOTEQUAL(0) RC8
/*
//CTL1CNTL DD *
SORT FIELDS=(1,1,CH,A)
/*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
|
|
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1337 Location: Bamberg, Germany
|
|
|
|
Try something like this:
Code: |
//PROC001 EXEC PGM=ICETOOL
//TMP DD DISP=(NEW,PASS),SPACE=..
//IN DD *
5
7
5
/*
//TOOLIN DD *
SELECT FROM(IN) TO(TMP) ON(1,80,BI) ALLDUPS
COUNT FROM(TMP) NOTEQUAL(0) RC8
/*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=* |
|
|
Back to top |
|
|
UnicornMaster
New User
Joined: 11 Mar 2021 Posts: 8 Location: Canada
|
|
|
|
Joerg.Findeisen wrote: |
Try something like this:
Code: |
//PROC001 EXEC PGM=ICETOOL
//TMP DD DISP=(NEW,PASS),SPACE=..
//IN DD *
5
7
5
/*
//TOOLIN DD *
SELECT FROM(IN) TO(TMP) ON(1,80,BI) ALLDUPS
COUNT FROM(TMP) NOTEQUAL(0) RC8
/*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=* |
|
IT WORKS ! THANKS A LOT !
However i have used
//TMP DD DISP=(NEW,PASS)
instead of
//TMP DD DISP=(NEW,PASS),SPACE=.. |
|
Back to top |
|
|
|