Author |
Packed Decimal in Openvms |
leonid
Member
Posts: 4
Joined: 15.08.17 |
Posted on August 15 2017 08:16 |
|
|
I have couple fields in the file which defined as PIC S9(4) COMP-3. When I display file (TYPE FILENAME) data appears as ASCII 26 (SU. How can I see real numeric value? Also when I FTP file to the text format how I can covert ASCII 26? Will appreciate forum's help. |
|
Author |
RE: Packed Decimal in Openvms |
abrsvc
Member
Posts: 108
Joined: 12.03.10 |
Posted on August 15 2017 12:25 |
|
|
The COMP-3 field is a binary format used primarily by COBOL. It encodes 2 decimal digits within a single byte and thus will save on storage requirements. While this was important many years ago when computer systems had memory in the kilobyte range, saving storage is not the primary factor anymore. If you are moving data from one system to another, I would simply code a program to read the binary data and create a straight text file as the output. This can then be FTP'd to the target system. Please note that the receiving program may also need to be updated to read the straight text file.
An alternative is to use a BINARY transfer which should retain the format of the records. Since you don't specify what the data is for, I can't tell whether or not a binary transfer will work as expected.
I hope this helps a bit.
Dan |
|
Author |
RE: Packed Decimal in Openvms |
Bruce Claremont
Member
Posts: 623
Joined: 07.01.10 |
Posted on August 16 2017 02:30 |
|
|
Binary transfer will preserve the packed decimal. You can read the packed decimal values via a DUMP if so desired. However, a better method would be to use a COBOL or similar program that recognizes packed decimal data and unpack the fields. |
|
Author |
RE: Packed Decimal in Openvms |
leonid
Member
Posts: 4
Joined: 15.08.17 |
Posted on August 16 2017 13:37 |
|
|
Dan, Bruce thank you very much for reply! |
|