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

Field offsets of VSAM file using COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

PostPosted: Thu May 24, 2007 4:52 am
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

Moderator Emeritus


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

PostPosted: Thu May 24, 2007 5:23 am
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
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: 3156
Location: Tucson AZ

PostPosted: Thu May 24, 2007 4:15 pm
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

Moderator Emeritus


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

PostPosted: Thu May 24, 2007 7:13 pm
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
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

Moderator Emeritus


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

PostPosted: Tue May 29, 2007 8:06 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top