MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Inserting values into a record

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
patnekar
Beginner


Joined: 27 Jan 2003
Posts: 41
Topics: 16

PostPosted: Fri Jan 09, 2004 10:46 am    Post subject: Inserting values into a record Reply with quote

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
View user's profile Send private message Yahoo Messenger
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Jan 09, 2004 11:13 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
patnekar
Beginner


Joined: 27 Jan 2003
Posts: 41
Topics: 16

PostPosted: Fri Jan 09, 2004 11:17 am    Post subject: Reply with quote

Frank,
Thanks for the response. Unfortunately my shop has only Syncsort

Thanks
Puru
Back to top
View user's profile Send private message Yahoo Messenger
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Mon Jan 12, 2004 2:57 am    Post subject: Reply with quote

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
View user's profile Send private message
patnekar
Beginner


Joined: 27 Jan 2003
Posts: 41
Topics: 16

PostPosted: Mon Jan 12, 2004 2:14 pm    Post subject: Reply with quote

Coolman,
No, I want to insert the value which occurs in that position. Each record has different values.

Thanks,
Puru
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Mon Jan 12, 2004 6:14 pm    Post subject: Reply with quote

patnekar,

what is the max no: of records in the second file?

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
patnekar
Beginner


Joined: 27 Jan 2003
Posts: 41
Topics: 16

PostPosted: Wed Jan 21, 2004 9:56 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group