Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
datatype for sign without occupying bytes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
sudhaaa

New User


Joined: 24 Mar 2005
Posts: 51

PostPosted: Fri Feb 18, 2011 4:20 pm    Post subject: datatype for sign without occupying bytes
Reply with quote

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
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1777
Location: Bloomington, IL

PostPosted: Fri Feb 18, 2011 4:43 pm    Post subject: Re: datatype for sign without occupying bytes
Reply with quote

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
View user's profile Send private message
sudhaaa

New User


Joined: 24 Mar 2005
Posts: 51

PostPosted: Fri Feb 18, 2011 4:52 pm    Post subject:
Reply with quote

I declared my PL/1 variable as '999V99T' and observed that this also allocated 6 digits
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1777
Location: Bloomington, IL

PostPosted: Fri Feb 18, 2011 5:26 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Hardcoded negative sign value in output scdinesh SYNCSORT 8 Fri Sep 08, 2017 5:28 am
No new posts Error in SQL-PLIST3 'Above value tru... rikdeb DB2 4 Wed Sep 06, 2017 1:34 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us