View previous topic :: View next topic
|
Author |
Message |
meena90
New User
Joined: 13 Oct 2008 Posts: 4 Location: Chennai
|
|
|
|
Hi All,
I have two input file
F1 - VB of Record length = 250
F2 - VB of record length = 1(which will be a character)
I need to append the data in file2 to file1.Can anyone help me out regarding this.
Thanks,
Meena |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
//COPYSTEP EXEC PGM=SORT
//SORTIN DD DSN=FILE2,DISP=SHR
//SORTOUT DD DSN=FILE1,DISP=MOD
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
|
Gerry |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Or do you mean that you want the data of file 1 to be followed by the data of file 2 in one record.
Please ask your questions in a clear manner. |
|
Back to top |
|
|
meena90
New User
Joined: 13 Oct 2008 Posts: 4 Location: Chennai
|
|
|
|
Hi Expat,
Ya,I need the data of file1 to be followed by the data of file2.
Thanks,
Meena |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
OK, still not quite clear. Which scenario below is what you want:
#1
Code: |
File1-Record1
File1-Record2
.
.
.
File2-Record1
File2-Record2
.
.
.
|
#2
Code: |
File1-Record1 File2-Record1
File1-Record2 File2-Record2
.
.
.
|
|
|
Back to top |
|
|
meena90
New User
Joined: 13 Oct 2008 Posts: 4 Location: Chennai
|
|
|
|
I need for the second one.
Thanks,
Meena |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Are there the same number of records in File 1 and File 2?
Are they both already in sorted order? |
|
Back to top |
|
|
meena90
New User
Joined: 13 Oct 2008 Posts: 4 Location: Chennai
|
|
|
|
There are equal no of records in it(say File1 and file2 both have 5 records). And they are not sorted.
Input in File1:
ID# Department Class
----- -------------- -------
10 4 2
12 2 1
Input in File2:
Flag
-----
Y
Y
Expected output:
ID# Department Class Flag
----- -------------- ------- -----
10 4 2 Y
12 2 1 Y |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
F2 - VB of record length = 1(which will be a character) |
Just curious how could somebody alloacte a VB file of LRECL=1. VB files have a 4 byte RDW and AFAIK, you'll not be able to have LRECL less than or equal to 4. I believe it's better to have an FB file of same length rather than having a 5 byte file.
Also since file-1 is a VB file, how will you handle this scenario? Where do you want to append the file-2 character in the below case?
Code: |
file-1,record-1
file-1,record---------2
file-1,record---------------3 |
|
|
Back to top |
|
|
|