Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Merge files using ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
pushpagiri

Active User


Joined: 07 Jul 2005
Posts: 50

PostPosted: Wed Jan 04, 2006 6:47 pm    Post subject: Merge files using ICETOOL
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
References
Alain Benveniste

Active User


Joined: 14 Feb 2005
Posts: 90

PostPosted: Wed Jan 04, 2006 8:02 pm    Post subject: Re: Merge files using ICETOOL
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 Moderator


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

PostPosted: Wed Jan 04, 2006 9:53 pm    Post subject:
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

Active User


Joined: 07 Jul 2005
Posts: 50

PostPosted: Thu Jan 05, 2006 10:08 am    Post subject:
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 Moderator


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

PostPosted: Thu Jan 05, 2006 9:13 pm    Post subject:
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1