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

Splice multiple records into single record using icetool


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
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: 452
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: 2455
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
murali.andaluri

New User


Joined: 07 Jun 2013
Posts: 23
Location: USA

PostPosted: Wed Jan 27, 2021 8:54 pm
Reply with quote

Hi Sarankriya,

I got similar requirement to achieve.

Did you find the answer for your query? If yes, could you please provide the solution?

Thanks,
Murali
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1009

PostPosted: Wed Jan 27, 2021 9:50 pm
Reply with quote

murali.andaluri wrote:
Hi Sarankriya,

I got similar requirement to achieve.

Did you find the answer for your query? If yes, could you please provide the solution?

Thanks,
Murali


Both of you: try to use in Google the search string like 'SORT JOIN operation'

Google bless you!
Back to top
View user's profile Send private message
murali.andaluri

New User


Joined: 07 Jun 2013
Posts: 23
Location: USA

PostPosted: Wed Jan 27, 2021 10:15 pm
Reply with quote

Hi Sergeyken,

I tried with join keys, but couldn't find solution for Sort Join with three input files.
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1009

PostPosted: Thu Jan 28, 2021 12:55 am
Reply with quote

murali.andaluri wrote:
Hi Sergeyken,

I tried with join keys, but couldn't find solution for Sort Join with three input files.

I do not believe you ever tried something on your own... icon_rolleyes.gif

Please demonstrate, how did you use any solution with two datasets??!! icon_lol.gif

Sort Join solution on three datasets is just applying it to the first two files, and next - applying similar solution to the result of previous step, and the third dataset...

Unless you demonstrate that you really did something by yourself, I personally refuse to give you any working example.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Thu Jan 28, 2021 1:39 am
Reply with quote

topic locked as it was hijacked
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Add column to existing records using ... JCL & VSAM 2
No new posts Syncsort- Merging two records into on... SYNCSORT 3
This topic is locked: you cannot edit posts or make replies. ICETool reporting 2 das old dataset DFSORT/ICETOOL 13
No new posts How to find orphaned MCDS D records. JCL & VSAM 15
No new posts fetch the record number from FMNMAIN ... CLIST & REXX 10
Search our Forums:

Back to Top