I need suggestions on how better to handle this, or if there is a smarter way to approach this problem.
I have a key record and its getting replaced with a new key. Each of these keys are stored in separate database and holds relevant information. Ultimate goal is to see what the true new key would be.
Lets say KEY1 is superseded by KEY2 and KEY2 is superseded by KEY3, I need to be able to map the KEY1 to KEY3 efficiently.
I have been thinking of join or splice, but it looks like I do not know upfront how many times I need to splice the file. What is the best way to find what the true new key would be?
1. Write a COBOL program.
2. Load the data in a temporary DB2 table and use recursive select (depends on your DB2 version).
1) Not an option since our shops uses only PL1. Since the records span to little above million, PL1 would be slower.
2) Again not an option, hand tied. For security reasons, we cannot load into DB2 tables. Input file is a flat file which was extracted by a vendor from DB2 tables and these are industry standard files.
Any way you could think about on SORT/ or some in-house products. I am also looking for less number of iterations.
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
nartcr wrote:
Any way you could think about on SORT/ or some in-house products. I am also looking for less number of iterations.
Only You will know which "In House" products you have, we don't.
The first step is to figure out the logic or process flow for doing what you want and then attempting to apply that to your sort product, but as others have said a program will almost certainly be the best solution.
The number of iterations will also depend on your programming skills as much as the product being used.
Any way you could think about on SORT/ or some in-house products. I am also looking for less number of iterations.
Only You will know which "In House" products you have, we don't.
The first step is to figure out the logic or process flow for doing what you want and then attempting to apply that to your sort product, but as others have said a program will almost certainly be the best solution.
The number of iterations will also depend on your programming skills as much as the product being used.
Thanks Expat. I didnt mean in house products, was a typo :). No problem, i will see what i can do.
If maximum level of key substitution is limited to a reasonable value, this can be done with only JCL+SORT utility. (It stops automatically when no more keys are substituted, up to 10 levels in this example)
If the replacement level is unpredictable (that is unlikely?), then the same approach can be done, let's say, by calling SORT in the same manner from REXX, from some DO WHILE RC=0 loop.
If maximum level of key substitution is limited to a reasonable value, this can be done with only JCL+SORT utility. (It stops automatically when no more keys are substituted, up to 10 levels in this example)
If the replacement level is unpredictable (that is unlikely?), then the same approach can be done, let's say, by calling SORT in the same manner from REXX, from some DO WHILE RC=0 loop.
Thanks a Bunch. Very smart. I was able to use it for getting my desired results.