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

Merge Utility


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

New User


Joined: 22 Jan 2008
Posts: 85
Location: India

PostPosted: Wed May 05, 2010 11:40 am
Reply with quote

I have a question,
File 1

POID 20100105PO#0000879354T 15700100000526203157001000115509
PODETAIL 1570010000000000000301258300000000010EA000011900
PODETAIL 1570010000000000789601258301000000010EA000009900
POID 20100105PO#0000879383I 15700100000422103157001000115509

File 1 has the above details. I have a copybook to view this file, but as you see there are two different layouts inside the same copy book. So its not possible to use file aid to view this file.

Now I wrote a sort card to remove the records which start with "POID" into file 2 and "PODETAIL" into file 3.
I separated the copybooks and viewed in file aid.

Now I want to merge File 2 and File 3 to the same old File 1. Is it possible?
Since File 2 has only POID records and File 3 has only PODETAIL records, I want to merge these two files and get the original file. After the 1st POID record, first two PODETAIL record should be appended, then the second POID then the 3rd and 4th PODETAIL record should be added.

Can we do this in merge utility? or should be write a cobol program?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed May 05, 2010 11:44 am
Reply with quote

Hello Usha,

I am not able to recognized the key offset which relate detail record to header. Would be able to help you out if you provide same?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed May 05, 2010 11:45 am
Reply with quote

certainly you can do so by simple sort step but why you want to do so?

As you said always 1st and last rec will be POID rec.

I am not aware of file aid but why cant you just view the file with copybook of PODETAIL rec, ignore just first and last rec while viewing.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed May 05, 2010 2:09 pm
Reply with quote

Escapa wrote:
As you said always 1st and last rec will be POID rec
Escapa,

Did the TS say this? icon_eek.gif I suspect, there are multiple PODETAIL record groups enclosed by POID records.

usharaniA wrote:
I want to merge these two files and get the original file
usharaniA,

You had a file. Since u were unable to view it, you separated it into 2 files and viewed them. Now what happened to the original source file? Why do you want to merge and get the original file? What is the difference between this 'merge'd file and your original input file?
usharaniA wrote:
So its not possible to use file aid to view this file.
And if just to view POID or PODETAIL records alone, you could have given a 'SELECTION CRITERIA' in fileaid instead of separating them.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed May 05, 2010 5:46 pm
Reply with quote

/little bit off topic
Quote:
Can we do this in merge utility?
MERGE is not a utility and if there is I'm not aware of it - please educate me. On the other hand, if you are talking about the MERGE control statement of SORT, I'm not sure if we can call it MERGE-utility? What are you referring to?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed May 05, 2010 7:03 pm
Reply with quote

Quote:
Now I want to merge File 2 and File 3 to the same old File 1. Is it possible?
I must assume that you have altered the contents of file 2 and/or file 3 and now want to reunited the two back into one, is this correct?

Why not view/alter the original file two times, first with the POID copybook and then with the PODETAIL copybook?

They can be merged it you can identify a common sequential key.

It they are entirely dependent upon physical sequence (i.e., no common sequential key), would adding a sequence number to the ens of the records as you split them mess up the viewing/altering with the copybooks in File aid?

Quote:
MERGE is not a utility and if there is I'm not aware of it - please educate me.
Oh, lighten up..... icon_rolleyes.gif
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Wed May 05, 2010 7:18 pm
Reply with quote

Just a note: did you know that File-Aid has an option that provides the capability to define different record types, each with their own record layout? The manual says:

"The record layout cross reference (XREF) function enables you to create and maintain XREFs. File-AID uses an XREF to automatically match record layouts to data records for its functions that use layouts to format data. An XREF is needed when the data being formatted requires more than a single record layout."
Back to top
View user's profile Send private message
DB2 Guy

New User


Joined: 28 Oct 2008
Posts: 98
Location: Cubicle

PostPosted: Wed May 05, 2010 8:26 pm
Reply with quote

CICS Guy wrote:
Quote:
MERGE is not a utility and if there is I'm not aware of it - please educate me.
Oh, lighten up..... icon_rolleyes.gif
IMHO, I believe terminology is important in IT and that's what, I believe, Anuj was pointing to.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed May 05, 2010 9:02 pm
Reply with quote

DB2 Guy wrote:
IMHO, I believe terminology is important in IT and that's what, I believe, Anuj was pointing to.


IMUO,
I believe the point towards which CICS Guy was referring is
that there are so many flagrant 'misnomers' on this board
(which by the way, this very website propagates with its free downloads of COMPILE JCLs )
using the term merge utility is ok.
In fact, DFSORT, SYNCSORT, CA-SORT are
sort utillities,
and merge utilities
and copy utilities.
Back to top
View user's profile Send private message
DB2 Guy

New User


Joined: 28 Oct 2008
Posts: 98
Location: Cubicle

PostPosted: Wed May 12, 2010 4:23 pm
Reply with quote

icon_smile.gif, you seem to be on both side of the fence Dick.
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 REASON 00D70014 in load utility DB2 6
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
No new posts Merge 2 input files after sort SYNCSORT 14
Search our Forums:

Back to Top