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

Merging 2 files


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shanudarling
Warnings : 1

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Fri Jun 15, 2012 11:22 pm
Reply with quote

I have 2 sequential files and both have the same record length.
File A contains some data
File B contains notes

My task is copy the contents of file B into file A at the end of file A.
Both the files cannot be sorted as we cannot change the sequence of records.

File A
Code:

1|-1234.56|ABC|987.11|
WW1|ACCDGFHJJJ|987|123.11|
4|-1234.56|ABCCFDS|123987.11|
EFJ1|1A2WWE3|145678.99|QQWXXF|


File B
Code:

AAACGFDSGS SDLFSD SLFLS LSDF
SDFDSDSFLGRG GRELGREG WEWLF
DSFDSK R432R3 LGF SNGLKS 4324


Expected Output file -
Code:

1|-1234.56|ABC|987.11|
WW1|ACCDGFHJJJ|987|123.11|
4|-1234.56|ABCCFDS|123987.11|
EFJ1|1A2WWE3|145678.99|QQWXXF|
AAACGFDSGS SDLFSD SLFLS LSDF
SDFDSDSFLGRG GRELGREG WEWLF
DSFDSK R432R3 LGF SNGLKS 4324


I am exploring if this can be done by a JCL only?

Thanks
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jun 15, 2012 11:27 pm
Reply with quote

Hello,

No, because NOTHING can be done "with a JCL only".

Suggest you concatenate the 2 input files and write a new output containing all of the records.

You can use your sort to do this.
Back to top
View user's profile Send private message
shanudarling
Warnings : 1

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Mon Jun 18, 2012 10:11 am
Reply with quote

Merged the files using the below jcl. Worked fine.

Code:

//STEP0001  EXEC  PGM=ICEMAN               
//SYSOUT    DD  SYSOUT=*                   
//SORTIN  DD DSN=DTEM.TEST.DATA.A,DISP=SHR 
//        DD DSN=DTEM.TEST.DATA.B,DISP=SHR 
//SORTOUT DD DSN=DTEM.TEST.DATA.C,DISP=SHR 
//SYSIN    DD    *                         
  OPTION COPY                               
/*                                         
[/code]
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Jun 18, 2012 11:33 am
Reply with quote

Hi,

you have copied/concatenated 2 files, not MERGED 2 files.

Gerry
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 18, 2012 6:43 pm
Reply with quote

Hello,

Quote:
Merged the files using the below jcl. Worked fine.
Yes, it worked because you did as suttested - concatenate the 2 input files.

Regardless of your improper use of the word "merge" you did NO merge. MERGE says there is a sequence to the data (some key(s) and typically data from the multiple files is interleaved by the merge process.

After doing this for more than 5 years, you should be using the correct terminology. Every time.
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top