We don't bite newbies here... much PerlMonks

### Re: EBCDIC and COBOL records

by Aim9b (Monk)
 on Jul 10, 2008 at 19:10 UTC ( #696779=note: print w/replies, xml ) Need Help??

in reply to EBCDIC and COBOL records

It's been a while, but in the IBM BigIron world, the x(292) is character data, and the two 9(8) COMP fields are 4 bytes of up to 8 digits zero-filled. Page 217 of the zOS COBOL Language Ref. offers the following...

Computational items
A computational item is a value used in arithmetic operations. It must be numeric. If the USAGE of a group item is described with any of these items, the elementary items within the group have this usage. The maximum length of a computational item is 18 decimal digits, except for a PACKED-DECIMAL item. If the ARITH(COMPAT) compiler option is in effect, then the maximum length of a PACKED-DECIMAL item is 18 decimal digits. If the ARITH(EXTEND) compiler option is in effect, then the maximum length of a PACKED-DECIMAL item is 31 decimal digits. The PICTURE of a computational item can contain only:
9 One or more numeric character positions
S One operational sign
V One implied decimal point
P One or more decimal scaling positions

COMPUTATIONAL-1 and COMPUTATIONAL-2 items (internal floating-point) cannot have PICTURE strings.

BINARY Specified for binary data items.
Such items have a decimal equivalent consisting of the decimal digits 0 through 9, plus a sign. Negative numbers are represented as the two’s complement of the positive number with the same absolute value. The amount of storage occupied by a binary item depends on the number of decimal digits defined in its PICTURE clause:
Digits in PICTURE clause = Storage occupied
1 through 4 = 2 bytes (halfword)
5 through 9 = 4 bytes (fullword)
10 through 18 = 8 bytes (doubleword)

Binary data is big-endian: the operational sign is contained in the leftmost bit.
BINARY, COMPUTATIONAL, and COMPUTATIONAL-4 data items can be affected by the BINARY and TRUNC compiler options. For information about the effect of these compiler options, see the Enterprise COBOL Programming Guide.

COMPUTATIONAL or COMP (binary) This is the equivalent of BINARY. The COMPUTATIONAL phrase is synonymous with BINARY.

Hope this helps. If you could post a sample record or two, I might be able to offer a bit more help. Good Luck.

Replies are listed 'Best First'.
Re^2: EBCDIC and COBOL records
by plegall (Initiate) on Jul 11, 2008 at 12:44 UTC
Here comes a set of files : definition1.txt comes with sample1.txt, definition2.txt comes with sample2.txt That's very kind of you if you can help :-)
plegall, I'm sorry, but all I can do is rule OUT some things...

First, Even though the name in your Data Division implies otherwise, your sample data is deffinitely not ASCII, it truely is EBCDIC.

Second, the 9(8) Comp fields do not look like anything I've seen before in a COMP field. The comp's I'm familiar with contain only 0-9, with one C/D for the + or - Sign. (ie. like the folowing, for \$123.45...
0024 Zone portion
0135 numeric portion

or in the case of a signed value of -3697...
006D
0397

So, my questions would be, what sort of data is this, and are you sure these are COMP fields? Sorry, I couldn't be more help. Good Luck. Aim9b.

Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://696779]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2022-01-18 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
In 2022, my preferred method to securely store passwords is:

Results (52 votes). Check out past polls.

Notices?