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

COBOL program for unknown Input file length


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Mar 04, 2009 8:26 am
Reply with quote

Hello,

Yup, it is also quite handy for generic file compare (the files need to be in sequence by "the key") - user specifies lrecl, key length, number of mis-matches after which to stop, "highlight" the differences, how much of the records to show, etc.

The first i used this was about 20 years ago - i remember where i was, but not which level of operating system and cobol compiler icon_confused.gif

Jasorn - which language was used to write your copybook parser?
Back to top
View user's profile Send private message
jasorn
Warnings : 1

Active User


Joined: 12 Jul 2006
Posts: 191
Location: USA

PostPosted: Wed Mar 04, 2009 8:48 am
Reply with quote

Dick,
I wrote the parser in cobol. Sometime in the 1990's. I was planning to use the cobol 2 eztrieve converter that comes with eztrieve somehow but never could get that to work well with redefines and occurs.

So I wrote my own. I recently modified it to also spit out a symnames file for dfsort after a couple hours of not being able to get the similar tool for that to work icon_smile.gif

Funny you should mention generic file compares because that's exactly why I wrote the parser. Two of the fields on it are key indicator and key sequence. The compare job builds a sort card based on those and sorts the files.

The compare program reads the parsed copybook into an array, uses records contains 0 and file compares are even easier than with eztrieve. I put in quite a few functions but never got around to implementing code to do some of the fancier things eztrieve compares can do such as first dup, last dup, no dup etc.

The nice part about my compare though is it matches on the key you define and then loops through the rest of the fields by looping through the parsed copybook and reports differences at the field level. I've yet to see another compare process do this.

And if you have a copybook for the file the coding is done.

Another nice thing is if you use the same field names you can compare two files with different layouts.

There are lots of other things I do with the parsed copybook and record contains 0. Basically since the code can be based on the fieldnames there is lots of potential.
Back to top
View user's profile Send private message
jasorn
Warnings : 1

Active User


Joined: 12 Jul 2006
Posts: 191
Location: USA

PostPosted: Wed Mar 04, 2009 4:40 pm
Reply with quote

dick, actually, it does program does that too icon_smile.gif. Since you created one for a client does that mean the one that comes with eztrieve is ;broken' and it's not just me?
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Wed Mar 04, 2009 9:00 pm
Reply with quote

It sound difficult in COBOL to parse a copybook like this. But it would be very useful. It would be great if you were willing to share this, but I understand completely if you do not wish to or cannot share this code.
Back to top
View user's profile Send private message
jasorn
Warnings : 1

Active User


Joined: 12 Jul 2006
Posts: 191
Location: USA

PostPosted: Thu Mar 05, 2009 5:02 am
Reply with quote

Douglas Wilder wrote:
It sound difficult in COBOL to parse a copybook like this. But it would be very useful. It would be great if you were willing to share this, but I understand completely if you do not wish to or cannot share this code.

Actually, I've been meaning to share this with the hopes the community would contribute enhancements.

I'm not sure now how my company would feel about that. I could check. While I created this on my own time and computer for the pc a long time ago and I wouldn't share any enhancements I made on my company's dime I'd have to see if there are legal ramifications.

I did get a bonus for this from my current employer. Actually, this is the 3rd company that's given me some kind of award for it icon_smile.gif

But it really wasn't that hard. Just a little unusual.
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 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 Using API Gateway from CICS program CICS 0
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top