Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Merging 2 files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Merging 2 files
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

Site Director


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

PostPosted: Fri Jun 15, 2012 11:27 pm    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Mon Jun 18, 2012 11:33 am    Post subject:
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

Site Director


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

PostPosted: Mon Jun 18, 2012 6:43 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us