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

Match 2 files using keys


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shilpa.khaire

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Thu Jun 18, 2009 2:43 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Jun 18, 2009 2:46 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Jun 18, 2009 2:52 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Jun 18, 2009 4:22 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Jun 18, 2009 4:27 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Jun 18, 2009 9:02 am
Reply with quote

Hi Dick,

I totally agree to that. icon_smile.gif 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
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top