View previous topic :: View next topic
|
Author |
Message |
usharaniA
New User
Joined: 22 Jan 2008 Posts: 85 Location: India
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Escapa wrote: |
As you said always 1st and last rec will be POID rec |
Escapa,
Did the TS say this? 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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
/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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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..... |
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
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 |
|
|
DB2 Guy
New User
Joined: 28 Oct 2008 Posts: 98 Location: Cubicle
|
|
|
|
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..... |
IMHO, I believe terminology is important in IT and that's what, I believe, Anuj was pointing to. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
DB2 Guy
New User
Joined: 28 Oct 2008 Posts: 98 Location: Cubicle
|
|
|
|
, you seem to be on both side of the fence Dick. |
|
Back to top |
|
|
|