Hi,

I have only a little home brew utility - better said an awk script (see
https://en.wikipedia.org/wiki/AWK)
which translates a very simple Copy Book Structure (without REDEFINES) a
creates the corresponding SQL Create Statement
We use in tables which are processed by COBOL basically only CHAR and
DECIMAL fields.

For example if we have an copy book like this

* Example
* COBOL Copy Book
*
01 FOOBAR-AREA.
* Characters
05 FOO PIC X(24).

05 BAR PIC XXX.
05 FOOBAR PIC 99.

* Numbers
FOO BAR BAZ
05 SPAM PIC S9(16) COMP-3.

05 EGGS PIC S9(04)V9(2).
05 SPAM-AND-EGGS PIC S9(07)V999 COMP-3.

then the script converts it into

create table FOOBAR_AREA (
FOO CHAR(24)
BAR CHAR(3)
FOOBAR DEC(2,0)
SPAM DEC(16,0)
EGGS DEC(6,2)
SPAM-AND-EGGS DEC(10,3)
)

Unfortunatelly it doesn't run on iSeries, but on the PC, because on the
iSeries I don't have the current awk version, only an old one.

If you are interested I can send you the source. Maybe you can use it as
is , or enhance it for your needs, or only for inspiration, how to
programm the better utility self :-)

The processing looks like this - see the picture




Regards

Roman




From:
Dan <dan27649@xxxxxxxxx>
To:
cobol400-l@xxxxxxxxxxxx
Date:
31.05.2016 20:10
Subject:
[COBOL400-L] Convert COBOL record layout specs to PF or DDL specs?
Sent by:
"COBOL400-L" <cobol400-l-bounces@xxxxxxxxxxxx>



We have a client who supplied us with COBOL record layout specs for a
rather large layout, and I was wondering if anyone has possession of or
has
seen a utility that will convert such specs into SQL DDL or PF specs
before
I go and invent that wheel.

- Dan

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.