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

Merge files using ICETOOL


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

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Wed Jan 04, 2006 6:47 pm
Reply with quote

HI,

Pls help me in doing this.
Code:
F1:
111
222

F2:
aaaa
aaaaa
aaa

F3:
bbb
bbbbb
bbbbbbbb


Code:
outfile:
111
aaaa
aaaaa
aaa
222
bbb
bbbbb
bbbbbbbb


Data in F1 is added as header for data in other files.
Number of records in F1 equals number of (files-1)
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Wed Jan 04, 2006 8:02 pm
Reply with quote

Can you have more than 1 group in files 2 & 3 ? If so, what differentiates 1 group to an other ?

alain
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 04, 2006 9:53 pm
Reply with quote

Push,

If you're just trying to copy record 1 from F1 before the F2 records and record 2 from F1 before the F3 records, you can use a straightforward method like this DFSORT/ICETOOL job:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//F1 DD *
111
222
/*
//F2 DD *
aaaa
aaaaa
aaa
/*
//F3 DD *
bbb
bbbbb
bbbbbbbb
/*
//OUT DD DSN=&&O1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//TOOLIN DD *
COPY FROM(F1) TO(OUT) USING(CTL1)
COPY FROM(F2) TO(OUT)
COPY FROM(F1) TO(OUT) USING(CTL2)
COPY FROM(F3) TO(OUT)
/*
//CTL1CNTL DD *
  OPTION STOPAFT=1
/*
//CTL2CNTL DD *
  OPTION SKIPREC=1,STOPAFT=1
/*


If you're trying to do something more complex, you need to explain in detail what you're trying to do.
Back to top
View user's profile Send private message
pushpagiri

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Thu Jan 05, 2006 10:08 am
Reply with quote

Hi Frank,

What can I do if i Have hundreds of files like this.Should i create 100 control cards to do this job / is there any easy way to do this ?

i.e.,F1 has 100 records and there are files from f2 to f101.I want to merge this many files.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jan 05, 2006 9:13 pm
Reply with quote

You could generate the control statements instead of hardcoding them.

I don't see an easier way to do it other than that unless there's some kind of regular pattern to all this. Do f2 to f101 all have the same number of records or can they have different numbers of records? Is there a pattern to the f1 records that would allow them to be generated or do they have to be taken from f1?
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top