Creating zoned decimal with COBOL preferred signs

book

Article ID: 17035

calendar_today

Updated On:

Products

CA PanAudit Plus CA Easytrieve Report Generator CA PAN/SQL

Issue/Introduction



Is there a way to define a signed zoned decimal field in CA Easytrieve so that positive values get a "C" sign?

Environment

Release:
Component: EZTRVE

Resolution

A zoned decimal field getting a positive amount in the left side of an assignment will always receive an 'F' sign under the CA Easytrieve product. 

If you need the 'C' cobol-like sign, you can code 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 a statement like this one:

    IF NUM-FLD GE 0 THEN BIN-FIELD = BIN=FLD AND X'CF'

    where NUM-FLD is the zoned field and BIN-FLD is the one-byte binary field.

Additional Information

This is only a workaround.  Please see the following post under the Communities for CA Easytrieve and support getting this new functionality implemented into the product:

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