View previous topic :: View next topic
|
Author |
Message |
jzhardy
Active User
Joined: 31 Oct 2006 Posts: 131 Location: brisbane
|
|
|
|
I have a VB input file as follows (base records are shown first)
Code: |
[key1] NN data [key2] data ...
[key1] NN data [key2] data ...
...
[key1] data [key2] data ...
|
I want to splice the base records into the the records matching on key1,key2. The only part I want
spliced in is the NN value. I'm having some problems with the correct reformatting - can someone help ? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
What control statements are you using? What does the output look like? What do you want the output to look like? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Please show a good example of your input records with actual values and more than one key1 and key2 value. Show the records you expect for output. Give the starting position, length and format of the relevant fields. Give the RECFM and LRECL of the input file. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
I wouldn't count on a reply, of the 3 posts he has started, none of them has ever been followed up on..... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Good. Less work for us. |
|
Back to top |
|
|
jzhardy
Active User
Joined: 31 Oct 2006 Posts: 131 Location: brisbane
|
|
|
|
input and output are both VB4096
input file of ...
111 01 abc 11 def
222 02 abc 22 ghi
333 01 wxy 33 xyz
111 __ ghi 11 uuu
222 __ cde 22 xxx
222 __ yyy 22 iii
(__ = spaces)
would become
111 01 ghi 11 uuu
222 02 cde 22 xxx
222 02 yyy 22 iii
hope this makes it a bit clearer ! |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Well there's a first time for everything.... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
jzhardy,
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (VB/4096)
//OUT DD DSN=... output file (VB/4096)
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(5,3,CH) ON(16,2,CH) -
WITHALL WITH(5,4) WITH(11,4086) VLENOVLY
/*
|
|
|
Back to top |
|
|
dineshness
New User
Joined: 25 Dec 2006 Posts: 63 Location: Perambalur
|
|
|
|
Frank,
Shouldn't the splice be done on both the key fields of the file like below
SPLICE FROM(IN) TO(OUT) ON(1,3,CH) ON(12,2,CH) -
WITHALL WITH(5,4) WITH(11,4086) VLENOVLY
I think only then
111 01 abc 11 def
111 __ ghi 11 uuu
would become as
111 01 ghi 11 uuu
Dinesh. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Dinesh,
Huh? My SPLICE operator does do it on both key fields:
SPLICE FROM(IN) TO(OUT) ON(5,3,CH) ON(16,2,CH) -
The first key field is 5,3,CH and the second key field is 16,2,CH. Note that the RDW is in position 1-4 so the first data position is 5, not 1.
So I'm not sure what you're saying. |
|
Back to top |
|
|
jzhardy
Active User
Joined: 31 Oct 2006 Posts: 131 Location: brisbane
|
|
|
|
THANKS - this works ok now. my problem was I was thinking that the base record is overlayed onto the duplicates; where it is in fact the other way around : the duplicates are overlayed onto the matching base record, generating a new record for each match ... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
More accurately, the WITH fields from each overlay record are spliced into the base record. |
|
Back to top |
|
|
dineshness
New User
Joined: 25 Dec 2006 Posts: 63 Location: Perambalur
|
|
|
|
Quote: |
Note that the RDW is in position 1-4 so the first data position is 5, not 1. |
Well...I didnt note it.
After all there is a first time for everything...
Dinesh. |
|
Back to top |
|
|
|