View previous topic :: View next topic |
Author |
Message |
patnekar Beginner
Joined: 27 Jan 2003 Posts: 41 Topics: 16
|
Posted: Fri Jan 09, 2004 10:46 am Post subject: Inserting values into a record |
|
|
Hello,
I have the following requirement.
Code: |
File 1 ( VB, LRECL 2004)
*****************************************
123456 ABCDE
*****************************************
File 2 ( VB, LRECL 2004)
*****************************************
123456 PATNEKAR
*****************************************
Desired output file
*****************************************
123456 ABCDE PATNEKAR
*****************************************
|
Whenever the first 6 bytes of the files match, I want to insert the data ( 'PATNEKAR') from the second file into the record of the first file. The problem I am facing is that both files are VB.
Could anyone please tell me a method of doing the same??
Thanks
Puru |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Fri Jan 09, 2004 11:13 am Post subject: |
|
|
The following DFSORT/ICETOOL job will do what you asked for. (Since your input files are VB, the RDW is in positions 1-4. Your 123456 field starts in position 5 and your PATNEKAR field starts in position 23.)
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=... input file 1
// DD DSN=... input file 2
//OUT DD DSN=... output file
//TOOLIN DD *
SPLICE FROM(CON) TO(OUT) ON(5,6,CH) WITH(23,8)
/*
|
For complete information on the SPLICE operator of DFSORT's ICETOOL, see:
http://www.storage.ibm.com/software/sort/mvs/uq90053/online/srtmutol.html#spl _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
patnekar Beginner
Joined: 27 Jan 2003 Posts: 41 Topics: 16
|
Posted: Fri Jan 09, 2004 11:17 am Post subject: |
|
|
Frank,
Thanks for the response. Unfortunately my shop has only Syncsort
Thanks
Puru |
|
Back to top |
|
|
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Mon Jan 12, 2004 2:57 am Post subject: |
|
|
Puru,
Is it always "PATNEKAR" that you want to insert?
Cheers,
Coolman
________
Honda 1300 specifications
Last edited by coolman on Sat Feb 05, 2011 1:32 am; edited 1 time in total |
|
Back to top |
|
|
patnekar Beginner
Joined: 27 Jan 2003 Posts: 41 Topics: 16
|
Posted: Mon Jan 12, 2004 2:14 pm Post subject: |
|
|
Coolman,
No, I want to insert the value which occurs in that position. Each record has different values.
Thanks,
Puru |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
patnekar Beginner
Joined: 27 Jan 2003 Posts: 41 Topics: 16
|
Posted: Wed Jan 21, 2004 9:56 am Post subject: |
|
|
Kolusu,
The maximum number of records in both files is close to 200,000. I used a COBOL pgm to meet this requirement. But if a SORT option is posted, it'll serve very well for future use.
Thanks
Puru |
|
Back to top |
|
|
|
|