Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Match 2 files using keys

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: Match 2 files using keys
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

Site Director


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

PostPosted: Thu Jun 18, 2009 2:46 am    Post subject:
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: 2284
Location: @my desk

PostPosted: Thu Jun 18, 2009 2:52 am    Post subject:
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

Site Director


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

PostPosted: Thu Jun 18, 2009 4:22 am    Post subject:
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

Site Director


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

PostPosted: Thu Jun 18, 2009 4:27 am    Post subject: Reply to: Match 2 files using keys
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: 2284
Location: @my desk

PostPosted: Thu Jun 18, 2009 9:02 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts PA02 - Programmtically control attent... dodithegreat IMS DB/DC 1 Thu Apr 06, 2017 8:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us