View previous topic :: View next topic
|
Author |
Message |
UnicornMaster
New User
Joined: 11 Mar 2021 Posts: 8 Location: Canada
|
|
|
|
Hi everyone,
I would like to return an RC8 if there are duplicates for specific columns of specific lines
So for example in the input bellow
The lines with 'thisLineDontRequireAttention' don't require attention
The lines with 'thisLineRequireAttention' require attention if there are duplicates in columns 26 28 and 30 (columns with 1 2 3)
The columns to validate if there are duplicates will always be thoses columns (26 28 and 30)
The string 'thisLineRequireAttention' will always be there for the lines that require attention
Input 1 - Return code = RC8 because there are two 1 in the lines 'thisLineRequireAttention' for the column 26
Code: |
thisLineDontRequireAttention data
thisLineRequireAttention 1 2 3
thisLineDontRequireAttention data
thisLineRequireAttention 1 4 5
thisLineDontRequireAttention data
|
Input 2 - Return code = RC0
Code: |
thisLineDontRequireAttention data
thisLineRequireAttention 1 2 3
thisLineDontRequireAttention data
thisLineRequireAttention 3 2 1
thisLineDontRequireAttention data
|
With the ICETOOL bellow i'm able to have in memory only the lines and columns that matters but i'm unable to select only the lines who are in duplicates for specific columns so the COUNT could works
Code: |
//PROC001 EXEC PGM=ICETOOL
//*
//IN1 DD *
thisLineDontRequireAttention data
thisLineRequireAttention 1 2 3
thisLineDontRequireAttention data
thisLineRequireAttention 1 4 5
thisLineDontRequireAttention data
//*
//TOOLIN DD *
COUNT FROM(IN1) NOTEQUAL(0) RC8 USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=COPY
INCLUDE COND=(1,24,CH,EQ,C'thisLineRequireAttention ')
OUTREC FIELDS=(1:26,1,
2:28,1,
3:30,1)
/*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//*
|
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Quote: |
Input 2 - Return code = RC0
Code:
Code: |
thisLineDontRequireAttention data
thisLineRequireAttention 1 2 3
thisLineDontRequireAttention data
thisLineRequireAttention 3 2 1
thisLineDontRequireAttention data |
|
Why RC=0 , col 28 has two 2s , isn't it ? typo?
There are ways to do it, one way is to GROUP these records 'thisLineRequireAttention' and PUSH it to compare 26,28 and 30 position between original and PUSH'd one record and INCLUDE only match ones to set RC 8 else 0 in CTL1CNTL. |
|
Back to top |
|
|
UnicornMaster
New User
Joined: 11 Mar 2021 Posts: 8 Location: Canada
|
|
|
|
Rohit Umarjikar wrote: |
Quote: |
Input 2 - Return code = RC0
Code:
Code: |
thisLineDontRequireAttention data
thisLineRequireAttention 1 2 3
thisLineDontRequireAttention data
thisLineRequireAttention 3 2 1
thisLineDontRequireAttention data |
|
Why RC=0 , col 28 has two 2s , isn't it ? typo?
There are ways to do it, one way is to GROUP these records 'thisLineRequireAttention' and PUSH it to compare 26,28 and 30 position between original and PUSH'd one record and INCLUDE only match ones to set RC 8 else 0 in CTL1CNTL. |
Yeah sorry its a mistake |
|
Back to top |
|
|
UnicornMaster
New User
Joined: 11 Mar 2021 Posts: 8 Location: Canada
|
|
|
|
Rohit Umarjikar wrote: |
Quote: |
Input 2 - Return code = RC0
Code:
|
There are ways to do it, one way is to GROUP these records 'thisLineRequireAttention' and PUSH it to compare 26,28 and 30 position between original and PUSH'd one record and INCLUDE only match ones to set RC 8 else 0 in CTL1CNTL. |
Ok i will explore this solution |
|
Back to top |
|
|
|