View previous topic :: View next topic
|
Author |
Message |
pushpagiri
New User
Joined: 07 Jul 2005 Posts: 51
|
|
|
|
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 |
|
|
Alain Benveniste
New User
Joined: 14 Feb 2005 Posts: 88
|
|
|
|
Can you have more than 1 group in files 2 & 3 ? If so, what differentiates 1 group to an other ?
alain |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
pushpagiri
New User
Joined: 07 Jul 2005 Posts: 51
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|