View previous topic :: View next topic
|
Author |
Message |
sudhaaa
New User
Joined: 24 Mar 2005 Posts: 51
|
|
|
|
Hi,
I am calling an cobol program from apl/1 program. Cobol program is defined output variable as pic S999V99 where 5 bytes are allocated
example:
05 in-amount S999V99.
05 in-text x(10).
Now I defined my pl/1 veriable as pic '999V99-' to receive above value. 6 bytes will be allocated for this.
05 in_amount '999V99-',
05 in_text char (10).
Hence my program is getting an extra byte into in_amount field ( 5 bytes from in-amount and 1 byte from in-text)
I asked to change the cobol copybook to include an extra field as below, but not successful in this (denied)
05 in-amount S999V99.
05 filler x(01).
05 in-text x(10).
Please advise if it possible to define variable in pl/1 to hold 5 bytes.
(I searched other pl/1 posts, but not find relavent, hence I placed this new post. Thanks) |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
sudhaaa wrote: |
Hi,
I am calling an cobol program from apl/1 program. Cobol program is defined output variable as pic S999V99 where 5 bytes are allocated
example:
05 in-amount S999V99.
05 in-text x(10).
Now I defined my pl/1 veriable as pic '999V99-' to receive above value. 6 bytes will be allocated for this.
05 in_amount '999V99-',
05 in_text char (10).
Hence my program is getting an extra byte into in_amount field ( 5 bytes from in-amount and 1 byte from in-text)
I asked to change the cobol copybook to include an extra field as below, but not successful in this (denied)
05 in-amount S999V99.
05 filler x(01).
05 in-text x(10).
Please advise if it possible to define variable in pl/1 to hold 5 bytes.
(I searched other pl/1 posts, but not find relavent, hence I placed this new post. Thanks) |
FIXED DEC (9,2), but you probably mean PICTURE '999V9T'; five bytes with zoned decimal numbers, the last byte having an "overpunched" sign (i.e., the high nybble is C (positive) or D (negative) instead of F (unsigned)). |
|
Back to top |
|
|
sudhaaa
New User
Joined: 24 Mar 2005 Posts: 51
|
|
|
|
I declared my PL/1 variable as '999V99T' and observed that this also allocated 6 digits |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
sudhaaa wrote: |
I declared my PL/1 variable as '999V99T' and observed that this also allocated 6 digits |
As expected, since that is the equivalent, IIRC, of S999V999; a PL/I T, unlike a COBOL S without a SIGN IS SEPARATE clause, occupies one byte.
You will note that I recommended PICTURE 999V9T, not 999V99T. Change your declaration accordingly. |
|
Back to top |
|
|
|