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
 

 

Help with splicing several records into one

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Help with splicing several records into one
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: 1439
Location: Bangalore,India

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

Elroy,

Go thru the followin old topic -

http://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    Post subject: Reply to: Help with splicing several records into one
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 Moderator


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

PostPosted: Wed Feb 20, 2008 9:45 pm    Post subject:
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 Moderator


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

PostPosted: Tue Aug 12, 2008 11:42 pm    Post subject:
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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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