HP3000-L Archives

August 2002, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tom Emerson <[log in to unmask]>
Reply To:
Tom Emerson <[log in to unmask]>
Date:
Wed, 14 Aug 2002 20:10:44 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (53 lines)
> -----Original Message-----
> From: Tracy Pierce
>
> While on this subject, does anybody have the magic cobol
> program that will
> read a copybook and write a program to produce comma-delimited-values
> output?  (I'll pay cash!)

that would be a "magic" program indeed -- what exactly do you mean by "read
the copybook" since you said yourself:

> ... there's no real NEED for correspondence between Image's
> descriptions and COBOL's descriptions ...

And with constructs such as

 01  buffer.
  05  key pic x(16).
  05  data pic x(80).
  05  format-1 redefines data.
   10  field-1a pic x(10).
   10  field-2a pic x(70).
  05  format-2 redefines data.
   10  field-1b pic s9(9) COMP.
   10  filler pic x(<the-rest>).

how would the program know which "format" to use for a given record?
[snappy answer: that's the job of the programmer in the first place...]

Besides, individual "programmer style" can make a huge difference to the
"parsability" of a copybook -- if you have a company-wide "standard" AND it
has been followed faithfully, then *PERHAPS* it is possible to create a
program to parse a copybook and create a program that dumps the data
according to the COBOL definitions instead of IMAGE definitions.

OTOH: if what you want is to take an EXISTING DATABASE and (using the
image/query format types) dump a dataset to a comma-delimited file, why not
use SUPRTOOL (commercial) or SELCOPY (contributed) [although now that I
think about it, I don't remember if selcopy actually has a "comma-delim"
output format -- if not, it would be pretty trivial to do, just tedious...]
These programs don't rely on a "copybook", which can redefine data formats
for various nefarious purposes...

Tom

p.s. You may send me a sample of a copylib entry or two you wish to parse,
and I'll make an estimate of the difficulty in creating a program specific
to your site -- after all, since I'm out of work, I have plenty of time to
devote to such a task...

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2