View previous topic :: View next topic
|
Author |
Message |
aravindunlimited
New User
Joined: 08 May 2006 Posts: 16
|
|
|
|
I have 4 files with a common primary key. Is there a way to SPLICE the 4 files with a single SPILCE command.
I tried pushing the files such a way that the whole format is created with space in between for induvidual files thinking that later when they are copied a straight SPLICE would merge it all in the required form
ABCDEF
ABCEEE
ABC123
what I did was
ABC DEF
ABCE EE
ABC 123
But the space from the last record will override the fields above.
help! |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Please post you JCL and control information. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
aravindunlimited,
I can't tell what you want from what you've posted. You talk about four files but you only show one file with three records. And the bit about the spaces has no context so I don't know what it means.
Please show an example of the records in each input file and the expected output records. Also, what is the RECFM and LRECL of each input file? |
|
Back to top |
|
|
aravindunlimited
New User
Joined: 08 May 2006 Posts: 16
|
|
|
|
//TOOLIN DD *
COPY FROM(INFILE3) TO(TEMP1) USING(CTL3)
COPY FROM(INFILE1) TO(TEMP1) USING(CTL1)
COPY FROM(INFILE2) TO(TEMP1) USING(CTL2)
COPY FROM(INFILE4) TO(TEMP1) USING(CTL4)
COPY FROM(TEMP1) TO(DSC)
SPLICE FROM(TEMP1) TO(OUTFILE) ON(1,10) -
WITH(21,6),WITH(27,3),WITH(30,7),USING(CTL5)
file1
1111111111aaa
2222222222bbb
file2
1111111111ooooooooo
2222222222ppppppppp
file 3
1111111111xx
2222222222yy
etc
Before splicing the control cards will arrange the temp file like
1111111111aaa
2222222222bbb
1111111111___ooooooooo
2222222222___ppppppppp
1111111111____________xx
2222222222____________yy
and splice it over the fields
What I expect is
1111111111aaaoooooooooxx
2222222222bbbpppppppppyy
What I expect is |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use WITHEACH to do that kind of thing. The first WITH(p,m) specifies the field you want from the first overlay record (e.g. ooooooooo in your example), the second WITH(p,m) specifies the field you want from the second overlay record (e.g. xx in your example), etc.
BTW, commas are not allowed between operands in SPLICE.
WITH(21,6),WITH(27,3),WITH(30,7),USING(CTL5)
should be:
WITH(21,6) WITH(27,3) WITH(30,7) USING(CTL5) |
|
Back to top |
|
|
|