IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Splice multiple records into single record using icetool


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

New User


Joined: 15 Apr 2020
Posts: 3
Location: India

PostPosted: Wed Apr 15, 2020 10:55 pm
Reply with quote

Hi!
I have a requirement as below:
File 1:

//IN1 DD *
11111 000000 IN
22222 000000 UK

File 2:

//IN2 DD *
11111 333333 IN
11111 333331 IN
22222 444441 UK
22222 444442 UK
22222 444443 UK

My output should be below:
11111 000000 IN 333333 333331
22222 000000 UK 444441 444442 444443

Tried with icetool but getting below ouput:
11111 000000 IN333333
22222 000000 UK444441

It takes either only first or last occurence.

this is what i have used:

COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT12) ON(1,5,ZD) WITHANY-
WITH(16,7) KEEPNODUPS

CTL1:INREC OVERLAY=(1,15,500Z)

CTL2: INREC OVERLAY=(1,5,16:7,6)
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 350
Location: Bamberg, Germany

PostPosted: Thu Apr 16, 2020 1:37 pm
Reply with quote

And you really think that someone is willing to help you providing only these little details? icon_evil.gif
Back to top
View user's profile Send private message
sarankriya

New User


Joined: 15 Apr 2020
Posts: 3
Location: India

PostPosted: Thu Apr 16, 2020 7:13 pm
Reply with quote

Apologies for not providing sufficient details

file1 is of length 15 bytes
1-5 bytes-Branch code
7-12 bytes-Account no(will be always zeroes)
14-15 bytes-country code

file2 is of length 15 bytes
1-5 bytes-Branch code
7-12 bytes-Account no
14-15 bytes-country code

Branch code is the key from first file where i need to get all the matching account no from file2 and i need to write all matching account no in a single record

File 1:

//IN1 DD *
11111 000000 IN
22222 000000 UK

File 2:

//IN2 DD *
11111 333333 IN
11111 333331 IN
22222 444441 UK
22222 444442 UK
22222 444443 UK

My output should be below:
11111 000000 IN 333333 333331
22222 000000 UK 444441 444442 444443
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2429
Location: Hampshire, UK

PostPosted: Thu Apr 16, 2020 7:27 pm
Reply with quote

What if there are no records in dataset (not file) 2 for a branch code in dataset 1? And the same for accounts for a branch in dataset 2 but that branch does not appear in dataset 1?
Back to top
View user's profile Send private message
sarankriya

New User


Joined: 15 Apr 2020
Posts: 3
Location: India

PostPosted: Thu Apr 16, 2020 11:42 pm
Reply with quote

Hi Nick,
File 2 is a master file.It would have all the combinations.
We have to match file 1 with file 2 to get in a single record.
If a record is in file2 but not in file1 ,thats nowhere needed
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Hexadecimal Group compare and write t... DFSORT/ICETOOL 5
This topic is locked: you cannot edit posts or make replies. Splice JCL into one record for DD sta... SYNCSORT 2
No new posts Need to split single line into two li... DFSORT/ICETOOL 7
No new posts Copying data from prev record using SORT SYNCSORT 19
No new posts Break a record into fields, each fiel... SYNCSORT 2

Back to Top