control the nybble on signed zoned decimal items
search cancel

control the nybble on signed zoned decimal items

book

Article ID: 93291

calendar_today

Updated On:

Products

PanAudit Plus Easytrieve Report Generator PAN/SQL

Issue/Introduction



Is there a way to control the nybble on signed zoned decimal items within the CA Easytrieve product?
 
The manual says: 
For non-negative, zoned decimal numbers on the left side of an assignment statement, CA Easytrieve® sets an F sign if EBCDIC 

Setting an "F" sign is reasonable if the intent is to to display the item. But an "F" sign is not what IBM Enterprise COBOL creates in this situation. This can result in problems, and degrades Easytrieve interoperability in mixed language environments. 

Environment

Release:
Component: EZTPLS

Resolution

Currently, in CA Easytrieve, there is no way to control the nybble on signed zoned decimal items.
The only work around is to perform a sign fix: redefine the last byte of the field as 1 byte binary, then AND it with X'CF'. This Idea is for CA Easytrieve to provide some method for the programmer to define whether a signed zoned decimal item should use a positive "C" sign or an unsigned "F" sign when the value is greater or equal to zero.

The above workaround, is what I can suggest at this time as the functionality is not yet in the CA Easytrieve product.
Here is more information on the workaround:
A zoned decimal field getting a positive amount in the left side of an assignment will always receive an 'F' sign.
 
If you need the 'C' cobol-like sign, you can do as follows:
1. Redefine the last byte of the zoned decimal field in question as a one-byte binary field.
2. Adjust the sign with an statement like this one: IF NUM-FLD GE 0 THEN BIN-FLD = BIN-FLD AND X'CF' where NUM-FLD is the zoned field and BIN-FLD is the one-byte binary field.

Additional Information

We have had this same request recently requested. I want to please give you this link under our Mainframe Community for the CA Easytrieve product and ask that you please vote it up. The more votes and support that this enhancenment receives, the more likely it is to have this functionality built into the product. Management also reviews these enhancements when deciding on the next functionality to include in the product.

Here is the link: https://communities.ca.com/ideas/235738099-define-zoned-decimal-fields-with-cobol-preferred-signs