View previous topic :: View next topic
|
Author |
Message |
shilpa.khaire
New User
Joined: 21 Jul 2006 Posts: 39 Location: US
|
|
|
|
Hi!
I want to match 2 files using a key. Its a prod and test file, so has same copybook. I have an easytrieve version copybook. So I am including this in the program as %CPYBK. Now I want to declare the keys for prod and test file which start at position 19 of the file.
File1-key
app-no 19 3 A
accno 22 21 A.
And my file definition is :
FILE PRDFILE
%CPYBK
My question is how do I declare the key for both files if I dont want to use a working storage variable for it? Is this possib;e? If yes, how?Just below the %CPYBK? IF not, how do I define the key? I am not sure how to define the starting position as 19. My definition is currently as below which does not contain teh starting position:
PRD-KEY W 24 A
PRD-KEY-ACC-APPSYS-ID PRD-KEY 3 A
PRD-KEY-ACCNO PRD-KEY +3 21 A
Thanks! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you specify the name, length, displacement and type, you can specify "other" names for fields previously named by the "cpybk".
Is cblcnvrt now working? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
shilpa.khaire,
Sorry for deviating from the main topic. But if this Eazytrieve is just to do a 2-file match, why dont you try achieving the same using your sort product-DFSORT or SyncSort.
Quote: |
I need to compare 2 files, a test file and prod file. So both have the same copybook and it has 2000 fields as mentioned earlier. So please let me know if there is an easier way of comparing all fields..instead of an IF stmt for each? |
I just found this in your previous topic. How long are your input records? Are you trying to compare the entire record? What you're expecting in the output, if 1)record present in both prod and test 2)record present in prod but not in test and vice versa. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Personally, i rarely-to-never suggest using a sort product to do what is really a "programming" requirement. Far too many times i see people writing multiple steps or multiple passes of the data to do what could be done in one rather straightforward bit of code. I have then had these same people ask how to make the rather awful implementation run faster. When i replace their several steps and multiple passes of the data with a single step that only passes the entire huge set of data one time, they are often not happy - just chagrined. . .
I also believe every "programmer" who is permitted to implement IT solutions should be familiar with and able to comfortably write a 2-file match/merge. . .
If something is completely a sort or utility requirement, great, but if there are more or complex business rules to be implemented (which includes using multiple other files or tables to meet the requirement), i believe one of the coding language(s) used on the system is a more appropriate choice than "doing what you can" with the sort or other utility and then still needing to implement more business logic behind this. I believe requirements should be individually looked at (by someone competent) to decide which is the proper implementation.
I believe the mandate that something "must be done with a jcl" is typically wrong and more proper assessment needs to be done. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Of course, i also believe the organizations that allow processes written in Easytrieve, sort, fileaid, or any other utility to be run in production without proper documentation and promotion processes are guilty of an incredible dis-service. . .
d |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Dick,
I totally agree to that. I would always go for a sort if the requirement is only to do a 2-file-match and if no other processing is involved. But if there are other processes involved, I would recommend writing some code. |
|
Back to top |
|
|
|