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

How to splice two files


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

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Wed Jan 04, 2006 5:36 pm
Reply with quote

Hi,

I have two files

File01

1111
2222
3333
4444
5555

file02

aaaa
bbbb
cccc
dddd
eeee

The record count in both the files is same in this case its 5

The output i want is

1111 aaaa
2222 bbbb
3333 cccc
4444 dddd
5555 eeee

That is the respective records from both the files have to be spliced together.

Regard,
Back to top
View user's profile Send private message
pushpagiri

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Wed Jan 04, 2006 6:52 pm
Reply with quote

hi fixdoubts,

Try this link.Your example is explained there..

ibmmainframes.com/viewtopic.php?t=7130&start=0&postdays=0&postorder=asc&highlight=
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 Jan 04, 2006 9:42 pm
Reply with quote

fixdoubts,

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1    DD DSN=...  file1
//IN2    DD DSN=...  file2
//TMP1   DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT    DD DSN=...  output file
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1) USING(CTL1)
COPY FROM(IN2) TO(TMP1) USING(CTL2)
SPLICE FROM(TMP1) TO(OUT) ON(12,8,ZD) WITH(7,5) USING(CTL3)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,5,X,5X,SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(5X,X,1,5,SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,OUTREC=(1,11)
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Joining files with intermittent heade... SYNCSORT 1
No new posts INPFIL FILES, FNAMES examples SYNCSORT 7
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts JCL to merge two files side by side DFSORT/ICETOOL 3
No new posts Create a specific record/file based o... SYNCSORT 8
Search our Forums:


Back to Top