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
 

 

Field offsets of VSAM file using COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
abhisheksharma

New User


Joined: 23 May 2007
Posts: 3
Location: UK

PostPosted: Thu May 24, 2007 12:51 am    Post subject: Field offsets of VSAM file using COBOL
Reply with quote

Hi,

I have a problem on which I need some help.

My requirement is to match two versions of a GDG based VSAM KSDS and the from records that have been modified, I need the offset(s) of all the fields that are modified e.g. File1 (old version) and File2 (new version) need to be compared. If key value K1 is present in both File1 and File2, I need to extract the offset(s) of all the fields that have been modified and put this data along with the key value K1 in a third (flat) file.

Is there some tool in COBOL that can serve my purpose?

I know that FileAid shows all the data I need online but don't know how to extract this from the batch interface of FileAid.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu May 24, 2007 4:52 am    Post subject:
Reply with quote

I know that all things can be accomplished, but your "requirement" just does not make sense.
"GDG based VSAM"?
"the offset(s) of all the fields that are modified"?
"need to extract the offset(s)"?
Maybe somebody out there understands what you need, but unless you figure out a way to convey your "requirement" in terms and vocabulary a DP/IT person understands....I just don't know.....

As an after-thought, try, in short sentences, to explain what you want/need like you are trying to tell a small (bright, but still young) child.....
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 May 24, 2007 5:23 am    Post subject:
Reply with quote

Hello,

Do you really need the offsets or do you just need to compare the 2 sets of data?

If you want to compare 2 files and show the differences field by field, i'd suggest using the copybook that already exists for the file (many/most production vsam files have a copybook) and a clone of that record layout with a "-X" appended to the field names in the clone.

Then read both files by the key and compare field by field outputting the "key value" and the contents of the fields that are changed. You can show "adds", "deletes", and updates using this approach.
Back to top
View user's profile Send private message
abhisheksharma

New User


Joined: 23 May 2007
Posts: 3
Location: UK

PostPosted: Thu May 24, 2007 1:38 pm    Post subject:
Reply with quote

To clarify, lets us there are 10 fields in a record on a KSDS file and fields 2 and 4 were modified today either thru CICS or thru any batch program. I need to get the byte offsets of fields 2 and 4 in the record, i.e. the starting byte position of these fields within this record. Does this clarify my requirement?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu May 24, 2007 4:15 pm    Post subject:
Reply with quote

Other than looking at the displacements on the compile listing or just counting bytes looking at the record discription or copybook, I'm not sure there is any other way....
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 May 24, 2007 7:13 pm    Post subject:
Reply with quote

Hello,

I understood that you wanted the displacements, but i also thought it was to create "control cards" for some kind of compare utility. I may have misunderstood.

If the goal is not to compare and show differences, what will the displacements (offsets) be used for?

What will the offsets provide that the copybook will not? Keep in mind that if you use offsets, they will have to be re-done any time the record layout changes. If you use the copybook, the change will be trivial.
Back to top
View user's profile Send private message
abhisheksharma

New User


Joined: 23 May 2007
Posts: 3
Location: UK

PostPosted: Tue May 29, 2007 4:27 pm    Post subject:
Reply with quote

Hi Dick,

The offsets are required to sync-up an external database. The goal is to create an extract kind of a file that has the keys of the modified record, the offset(s) of the fields that are modified, the previous value in the field and the after value. The files I am looking at typically have around 1,000 fields each and each file has around 200,000 records on average (6 files), and any number of these 1000 fields in a record can be modified, so manual verification is ruled out.

Using the file matching concept, I can get the keys of the records that are modified. I am stuck at getting the displacement of the modified fields. This was previously done using assembler code but needs to be migrated to COBOL now.

Hope I got the requirement across clearly. Can you help me out? Can Fileaid provide me this data from it's batch interface?
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: Tue May 29, 2007 8:06 pm    Post subject:
Reply with quote

Hello,

How was the offset handled in the old assembler code?

You may be able to "re-write" the "old" code in COBOL using reference modification.

I'm not sure if File-Aid will provide what you want.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


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