View previous topic :: View next topic
|
Author |
Message |
tspr52
New User
Joined: 12 Sep 2006 Posts: 31 Location: Madrid, Spain
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please look in the DFSORT forum. You will see examples of what you want. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
tspr52
New User
Joined: 12 Sep 2006 Posts: 31 Location: Madrid, Spain
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
tspr52
New User
Joined: 12 Sep 2006 Posts: 31 Location: Madrid, Spain
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
tspr52
New User
Joined: 12 Sep 2006 Posts: 31 Location: Madrid, Spain
|
|
|
|
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 |
|
|
|