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

Splice - reformatting problem


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

Active User


Joined: 31 Oct 2006
Posts: 131
Location: brisbane

PostPosted: Tue Feb 13, 2007 12:56 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 13, 2007 3:18 pm
Reply with quote

What control statements are you using? What does the output look like? What do you want the output to look like?
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: Tue Feb 13, 2007 9:49 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 13, 2007 9:53 pm
Reply with quote

I wouldn't count on a reply, of the 3 posts he has started, none of them has ever been followed up on..... icon_rolleyes.gif
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: Tue Feb 13, 2007 9:59 pm
Reply with quote

Good. Less work for us. icon_rolleyes.gif
Back to top
View user's profile Send private message
jzhardy

Active User


Joined: 31 Oct 2006
Posts: 131
Location: brisbane

PostPosted: Wed Feb 14, 2007 2:24 am
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Feb 14, 2007 2:33 am
Reply with quote

icon_eek.gif Well there's a first time for everything.... icon_rolleyes.gif
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 Feb 14, 2007 4:55 am
Reply with quote

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
View user's profile Send private message
dineshness

New User


Joined: 25 Dec 2006
Posts: 63
Location: Perambalur

PostPosted: Wed Feb 14, 2007 11:24 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Feb 15, 2007 12:40 am
Reply with quote

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
View user's profile Send private message
jzhardy

Active User


Joined: 31 Oct 2006
Posts: 131
Location: brisbane

PostPosted: Thu Feb 15, 2007 6:29 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Feb 15, 2007 10:01 pm
Reply with quote

More accurately, the WITH fields from each overlay record are spliced into the base record.
Back to top
View user's profile Send private message
dineshness

New User


Joined: 25 Dec 2006
Posts: 63
Location: Perambalur

PostPosted: Thu Feb 15, 2007 11:25 pm
Reply with quote

Quote:
Note that the RDW is in position 1-4 so the first data position is 5, not 1.


Well...I didnt note it. icon_smile.gif

After all there is a first time for everything... icon_biggrin.gif

Dinesh.
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 Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
Search our Forums:

Back to Top