IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

RC8 IF duplicates


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
UnicornMaster

New User


Joined: 11 Mar 2021
Posts: 8
Location: Canada

PostPosted: Fri Mar 12, 2021 1:36 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Mar 12, 2021 3:09 am
Reply with quote

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
View user's profile Send private message
UnicornMaster

New User


Joined: 11 Mar 2021
Posts: 8
Location: Canada

PostPosted: Fri Mar 12, 2021 3:31 am
Reply with quote

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
View user's profile Send private message
UnicornMaster

New User


Joined: 11 Mar 2021
Posts: 8
Location: Canada

PostPosted: Fri Mar 12, 2021 4:14 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to remove block of duplicates DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
No new posts Merging 2 files but ignore duplicate... DFSORT/ICETOOL 1
No new posts COUNT the number of duplicates DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. SUM FIELDS=NONE in reverse - Get dupl... DFSORT/ICETOOL 9
Search our Forums:

Back to Top