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

Copying two files into one using SORT


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

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Fri Mar 09, 2007 12:04 am
Reply with quote

Hello,

i have two files:

File A:

aa
bb
cc

File B

aaaaaaaaaaaa
bbbbbbbbbbbb
cccccccccccccc

And I need that:

File C

aa aaaaaaaaaaaa
bb bbbbbbbbbb
cc ccccccccccc

What can I do for do this concatenation?

Thanks for your help,

Jose Luis
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 09, 2007 12:33 am
Reply with quote

Hello,

Please look in the DFSORT forum. You will see examples of what you want.
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: Fri Mar 09, 2007 1:53 am
Reply with quote

If you want to join the records one-by-one, you can use the technique discussed in the "Join fields from two files record-by-record" Smart DFSORT Trick. If you want to join the records on a key, you can use the technique discussed in the "Join fields from two files on a key" Smart DFSORT Trick. You can find all of the Smart DFSORT Tricks at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Fri Mar 09, 2007 1:00 pm
Reply with quote

Thanks at all

Well, is the first thing i done, but i dont get any satisfactory result.


Is for that i need to obtein your help...with an example more especificative...

Thank you very much
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: Fri Mar 09, 2007 9:19 pm
Reply with quote

Then you need to be more specific about what you want to do. Do you want to join the records one-by-one (record 1 from fileA with record 1 from fileB, record 2 from fileA with record 2 from fileB, etc), or do you want to join the records on a key (what is the starting position, length and format of the key in each file?)
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Mon Mar 12, 2007 3:15 pm
Reply with quote

First of all, thanks very much for your help. Sometimes you feel very stupid when you waste a lot of time trying to resolve something that seems very easy and you cant make it run ok.

Well, i started for a file that give me two lines, one with the name of the member and another one with the compilation date.

I used the sort tricks book and now i have two files, one with the name of the program and another with the compilation date.

I did that for put those two strings in one line.

The strings are, for example:

File A (8 bytes)

QA2C7400
MD3C6790


File B
22/03/2006
22/06/2007

An need to put in one line:

FILE C

QA2C7400 22/03/2006
MD3C6790 22/06/2007


I try used the examples of the tricks book, but i just obtein an empty file.

Thanks you very very much.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 12, 2007 3:21 pm
Reply with quote

tspr52 wrote:
I try used the examples of the tricks book, but i just obtein an empty file.
Please post your JCL and control information.
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: Mon Mar 12, 2007 8:34 pm
Reply with quote

tspr52,

I guess you want to join line-by-line. 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=...  input file1 (FB/8)
//IN2 DD DSN=...  input file2 (FB/10)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/19)
//TOOLIN   DD    *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(20,8,ZD) -
  WITH(10,10) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(20:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  INREC BUILD=(10:1,10,20:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,19)
/*
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Tue Mar 13, 2007 3:20 pm
Reply with quote

Thanks very much Frank, god bless you :-)

I had a lot of jcls trying to do the same.

Ok, i get the "logical funtion" to use this tool.

Thanks again.

Jose Luis
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 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top