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

Help with splicing several records into one


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

New User


Joined: 19 Apr 2006
Posts: 3

PostPosted: Wed Feb 20, 2008 1:06 pm
Reply with quote

I'm trying to learn how to use the ICETOOL. The problem I have is that I have several files which I need to merge/splice into one file e.g.

Code:

FILE1: KEY                        STUFF
FILE2: KEY KEY1
FILE3: KEY        KEY2
FILE4: KEY                KEY3


Result:

Code:

OUT:   KEY KEY1   KEY2    KEY3    STUFF


I'd like to merge all of these in one pass if possible. From looking at the manual (DFSORT Application Programming Guide 3rd Ed.) it seems I needs to use a splice and WITHEACH (there is an example of something which looks like what I'm suggesting at the top of pg. 583), but I'm not sure how I need to do this.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Feb 20, 2008 2:13 pm
Reply with quote

Elroy,

Go thru the followin old topic -

www.ibmmainframes.com/viewtopic.php?t=26182&highlight=splice
Back to top
View user's profile Send private message
Elroy

New User


Joined: 19 Apr 2006
Posts: 3

PostPosted: Wed Feb 20, 2008 6:08 pm
Reply with quote

Thanks Murali,


This is nearly what I need but not quite...

The problem is that the keys don't always exist in all of files 2,3 and 4. In this situation it's merging the wrong part of the record and I end up with blanks where I should have data.

Any ideas? Thanks.
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 20, 2008 9:45 pm
Reply with quote

Elroy,

Please show a better example of the records in your input files (relevant fields only), including the case that doesn't work, and the expected output records. Give the RECFM and LRECL of the input files. Give the starting position, length and format of each relevant field in each input file.
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 Aug 12, 2008 11:42 pm
Reply with quote

With z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can do this kind of thing quite easily with the new WITHANY operand of SPLICE like this:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//CON DD DSN=...  input file1
//    DD DSN=...  input file2
//    DD DSN=...  input file3
//    DD DSN=...  input file4
//OUT DD DSN=...  output file
//TOOLIN DD *
SPLICE FROM(CON) TO(OUT) ON(1,3,CH) WITHANY -
  WITH(5,4) WITH(12,4) WITH(20,4) WITH(28,5)
/*


For complete details on the new WITHANY function and the other new functions available with PTF UK90013, see:

Use [URL] BBCode for External Links
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top