Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Splice - reformatting problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
jzhardy

New User


Joined: 31 Oct 2006
Posts: 23
Location: brisbane

PostPosted: Tue Feb 13, 2007 12:56 pm    Post subject: Splice - reformatting problem
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: 3158
Location: Tucson AZ

PostPosted: Tue Feb 13, 2007 3:18 pm    Post subject:
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 Moderator


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

PostPosted: Tue Feb 13, 2007 9:49 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Tue Feb 13, 2007 9:53 pm    Post subject:
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 Moderator


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

PostPosted: Tue Feb 13, 2007 9:59 pm    Post subject:
Reply with quote

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

New User


Joined: 31 Oct 2006
Posts: 23
Location: brisbane

PostPosted: Wed Feb 14, 2007 2:24 am    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Wed Feb 14, 2007 2:33 am    Post subject:
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 Moderator


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

PostPosted: Wed Feb 14, 2007 4:55 am    Post subject:
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    Post subject: Re: Splice - reformatting problem
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 Moderator


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

PostPosted: Thu Feb 15, 2007 12:40 am    Post subject:
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

New User


Joined: 31 Oct 2006
Posts: 23
Location: brisbane

PostPosted: Thu Feb 15, 2007 6:29 am    Post subject:
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 Moderator


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

PostPosted: Thu Feb 15, 2007 10:01 pm    Post subject:
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    Post subject: Re: Splice - reformatting problem
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us