Convert Cobol COMP data to ASCII

I am converting some COBOL data file to ASCII using vutil utility:

vutil -extract input.dat > output.txt

      

I cannot get a human readable response from the COMP data fields. Here is part of my FD file

05 FAT-TIPOFT   PIC 9(4).
05 FAT-DINI     PIC 9(8).
05 FAT-DFIN     PIC 9(8).
05 FAT-IMPON    PIC S9(7)V99 COMP.
05 FAT-INPS     PIC 99.
05 FAT-IMPINPS  PIC S9(7)V99 COMP.
05 FAT-IVA      PIC 99.

      

And here's an example of an ASCII conversion:

0107200230062003 ‚p00    20  ³° 6 00     6       

      

Conversion is fine only for NON-COMP fields

Is there any additional command or alternative utility or technique for converting COMP fields?

Note. I don't want to go into the Cobol world, I just want to transform the data and get rid of it!

0


source to share


1 answer


Possible solutions:

  • You might not want to write a Cobol program for a single file, this will probably be the fastest and cheapest solution.

  • There are various commercial packages that claim to read Acu Cobol files, possibly expensive.

  • For this file, you can take a look at RecordEditor , with a bit of firmware that you could (and I mean can ) make it work. For this Cobol-Copybook, try importing it as Mainframe or Open-Cobol copies. I suspect Open-Cobol Microfocus might be better. (Note: I am the author of RecordEditor)


I think the data can be, without the binary and the original data, I can't be sure.

The first 16 bytes in the supplied data looks like 2 dates, so I aligned with FAT-DINI / FAT-DFIN, but this is just an assumption:



    0107200230062003  ‚p00    20
22223333333333333333008733000033
00000107200230062003002000000020

      

in RecordEditor I get:

enter image description here


There is a JRecord.properties in the RecordEditor lib directory to define Cobol dialects.

+2


source







All Articles