View previous topic :: View next topic
|
Author |
Message |
Elroy
New User
Joined: 19 Apr 2006 Posts: 3
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
Back to top |
|
|
Elroy
New User
Joined: 19 Apr 2006 Posts: 3
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|