I need to write a rexx tool to open a file in a specified format. I mean, I have the copybook of a dataset , and the dataset, now i need to design a tool, which will take the dataset and the copybook, and then open it against that layout as a dataset. Something like what file-aid does. Can anyone suggest how do i go about it?
Joined: 26 Apr 2004 Posts: 4650 Location: Raleigh, NC, USA
Search the forums for "REXX AND COPYBOOK". Your's isn't the first time this issue has been raised. I don't recall anyone offering a specific solution, but maybe you'll get some ideas for a starting point.
Let me make a general point ...
Suddenly somebody wakes up with the need to build a tool
the specifications are not clear, maybe they are, or at least they are expressed in a confusing way
but this somebody does not have the slightest idea on how to satisfy this need
tool writers should be aware that it takes more skill, research, ingenuity, creativity,
to write a tool than to write a plain stupid application program
the technologies implied are a much wider set than those used in plain application programming
I do not see any problem at all
1- write a parser for the copy book in order to provide the appropriate mapping ( offset, lenght, type, output format )
-- the parser could be a hand written parser or could be build by using a freely available parser/generator
-- check the family of yacc/bison parser in their different flavors
-- there are variants which generate parsers written in c or java
-- but then You would have to learn how to write a grammar for such tools
-- You are lucky, here is a cobol grammar ready made...
-- the parser should also take into account different mappings due to different record types
-- if You feel more comfortable in handling xml then You might just take a look at.....
2- read the dataset, applying to each record the appropriate mapping and output formatting
3- display the output record using an Ispf panel providing vertical and horizontal scrolling
et voila le jeux sont fait
at the end it will be cheaper to satisfy this compelling need by just buying a proper third party tool