Re: Crazy COBOL system, need help with cob2csv




Starkey2600@xxxxxxxxx wrote:
I've just been hired at a new company,

Unfortunately it doesnt seem that this gentleman designed by the
same set of rules that most did during the "COBOL Era" as I've seen
mention of copybook files and a seperate file for the db, however, the
system I'm working with is made up of lots and lots of .CBL, files that
contain a section of the code that appears to be the copybook, and then
the source. Then there are lots and lots of these files with no
extensions, but they appear to be binary db files, as i can make out
some of the plain text as db items.

So my question is how can I use cob2csv with this system? Do i copy
paste the copybook section into a seperate file?


cob2csv was written (assuming that it is the same program) by Robert
Wagner. He may (possibly) be contactable on robert@xxxxxxxxxxx My
understanding of the source (after spending a whopping 5 minutes
looking at it) is that you use a cbl file copybook tagged with the cpy
suffix as an input file to the program. It will interpret the FD and
use it as a guide for the program.

Cob2csv is written in MicroFocus Cobol but should be easily converted
to any other brand of Cobol. Robert Wagner posted the following:

<QUOTE>

You'll probably have to read it with a Cobol program compiled with MF
or a MF file tooll. If you still have access to the MS compiler or a
more recent MF compiler, cob2csv I posted here some months ago will do
the job. You'll need a Cobol copybook (include file) describing the
record layout.

IDX is an index you probably don't need. IND is the data you want. Try
editing the IND with a text editor; do the records line up? In the
unlikely event they do, it's C-ISAM and you might be able to read it
as ASCII text.

</QUOTE>

Within the code he wrote:

<QUOTE 2>
* Convert Cobol file to comma or tab delimited
*
* This program interprets a Cobol copybook describing a record layout,
* then converts the file to either csv or tsv (comma or tab delimited).

*
* This program would best be used by the organization sending the file,

* because it has a Cobol compiler and could better deal with
* ideisyncrasies in its file system. When used by the organization
* receiving the file, the program need be compiled only once. The
* executable will convert all files.
*
* This program also provides a simple demo of how to parse
* and interpret source code.
*
* Copybook file: cob2csv.cpy **!!!!!!!****
* Input data file: cob2csv.in
* Output data file: cob2csv.out
* Environment variable: delimiter=tab (default is comma)
* This program filters out data characters matching the delimiter.
* Supported formats: string, display numeric, binary and packed
decimal,
* simple OCCURS. REDEFINES is ignored, the first definition is used.
* Not supported: editing pictures, scaling, OCCURS at group level,
* OCCURS DEPENDING ON.
*
* If your machine is big-endian (a PC) or 32-bit, required changes
* are in comments below.

</QUOTE 2>

I tagged one line above with **!!!!!!**** (DD, could you check the
number of exclamation marks for me?) as this is where RW identifies the
copybook.

.



Relevant Pages

  • Re: Crazy COBOL system, need help with cob2csv
    ... Rename the source code FD copybook as a .cpy member. ... Cob2csv is written in MicroFocus Cobol but should be easily converted ... more recent MF compiler, cob2csv I posted here some months ago will do ...
    (comp.lang.cobol)
  • Re: COBOL COPY statement w REPLACING...
    ... Subject: SV: COBOL COPY statement w REPLACING... ... I want to be able to use REPLACING for such a copybook WITHOUT ... message is not the intended recipient or an authorized representative of the ... For IBM-MAIN subscribe / signoff / archive access instructions, ...
    (bit.listserv.ibm-main)
  • Crazy COBOL system, need help with cob2csv
    ... They now have a custom built ... COBOL software running their db, as I'm not the slightest bit ... mention of copybook files and a seperate file for the db, however, the ... contain a section of the code that appears to be the copybook, ...
    (comp.lang.cobol)
  • Re: COBOL COPY statement w REPLACING...
    ... Subject: SV: COBOL COPY statement w REPLACING... ... Från: IBM Mainframe Discussion List ... I want to be able to use REPLACING for such a copybook WITHOUT ... For IBM-MAIN subscribe / signoff / archive access instructions, ...
    (bit.listserv.ibm-main)
  • Re: Crazy COBOL system, need help with cob2csv
    ... rename the files that i have (the ones with the copybook info) to have ... Cob2csv is written in MicroFocus Cobol but should be easily converted ... more recent MF compiler, cob2csv I posted here some months ago will do ... Output data file: cob2csv.out ...
    (comp.lang.cobol)