Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hacking COBOL data file
Message
De
21/07/2000 19:03:47
 
 
À
21/07/2000 04:16:55
Dino Liberale
Ministero Lavori Pubblici
Trieste, Italie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00395249
Message ID:
00395772
Vues:
9
I had to solve a very similar problem extracting data from a Microfoucs Cobol .idx file. This was a Y2K project in which we rewrote a COBOL system in VFP.

These hints may help.
You will need a hexadecimal editor to examine the contents of the file.

1. Regarding numeric fields:

Each byte of the field represents two decimal digits of the mantissa of the number. The rightmost hexadecimal digit represents the sign. e.g. a value in HEXADECIMAL notation looks like:

00 17 50 0C
This represents the DECIMAL number 17500

The last digit in the hexadecimal number determines the sign
C for positive, D for negative.

The interpretation of where the decimal point goes depends on how the field was declared.

The above field was declared with
C-FEE PIC S9(5)V99 COMP-3.

and thus it has 2 decimal places, so the above hex number represents
+175.00

2. What if you don't have the FD's ?(I didn't either). I did have the compiled COBOL program which provided functions to view data. I could for example look at a transaction with the COBOL program and note that the fee was $175.00. Then I found the record and field in the actual file using a hex editor, noted the offset from the beginning of the record. In this way I was able to deduce the structure of the .idx file. This is admitedly laborious and a last resort, but it works if you can't locate the COBOL source and can't decompile the executable program.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform