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

How to replace a data element from file1 to another


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Raymond Sachs

New User


Joined: 13 Dec 2007
Posts: 45
Location: USA

PostPosted: Thu Mar 24, 2011 8:14 am
Reply with quote

Is it possible to copy a data element "position (9-12)" from a file1
into file2 at a position (17-20)

File1:
Code:
EDIT       PUBLIC.TST.FILE1
Command ===>               
****** *********************
000001 ABCD EF GHIJ         
****** *********************


File2:
Code:
EDIT       PUBLIC.TST.FILE2                       
Command ===>                                       
****** ***************************** Top of Data **
000001 XXXXXXYYYYYYYY  1234                       
****** **************************** Bottom of Data


We are a SYNCSORT shop.
Back to top
View user's profile Send private message
Raymond Sachs

New User


Joined: 13 Dec 2007
Posts: 45
Location: USA

PostPosted: Thu Mar 24, 2011 7:07 pm
Reply with quote

Dear Listers,

Is it not possible what I wanted to get done? Do I need to write a program to do it?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Mar 24, 2011 7:44 pm
Reply with quote

I believe that you would do well to search this forum for "OVERLAY".
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Mar 24, 2011 8:56 pm
Reply with quote

And be patient - you posted in the middle of the night for me and others. We all have real jobs to do that take priority over helping (or otherwise) in the forum. If you want 'quick' then search, read or pay.

And you have not given an example of your desired output. And...will bith your files have only 1 record? And...if multiple records how are they matched? Are there duplicates? etc etc eg. LRECL and RECFM
Back to top
View user's profile Send private message
Raymond Sachs

New User


Joined: 13 Dec 2007
Posts: 45
Location: USA

PostPosted: Thu Mar 24, 2011 9:19 pm
Reply with quote

Hi Nic,

The output will be a third file (LRECL=80) -
Code:
EDIT       PUBLIC.TST.FILE3                       
Command ===>                                       
****** ***************************** Top of Data **
000001 XXXXXXYYYYYYYY  GHIJ                       
****** **************************** Bottom of Data


Input:
File 1 LRECL = 30
File 2 LRECL = 80

Code:
EDIT       PUBLIC.TST.FILE1
Command ===>               
****** *********************
000001 ABCD EF GHIJ         
****** *********************

Code:
EDIT       PUBLIC.TST.FILE2                       
Command ===>                                       
****** ***************************** Top of Data **
000001 XXXXXXYYYYYYYY  1234                       
****** **************************** Bottom of Data
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Mar 24, 2011 9:27 pm
Reply with quote

how many records are in each file?

what are the matching columns?
Back to top
View user's profile Send private message
Raymond Sachs

New User


Joined: 13 Dec 2007
Posts: 45
Location: USA

PostPosted: Thu Mar 24, 2011 10:15 pm
Reply with quote

Hi Dick,

Each file contains one record and there both the files have the first four characters the same. Hence we can match on those.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top