Page 1 of 1

How to declare VP999 COMP-3 in easy Trieve ?

PostPosted: Mon Apr 09, 2012 3:22 pm
by sugavanesh
Could anyone tell me, how to declare VP999 COMP-3 in easy trieve and how to declare MASK for this field ?

Re: How to declare VP999 COMP-3 in easy Trieve ?

PostPosted: Mon Apr 09, 2012 3:28 pm
by BillyBoyo
Can you describe in words what you feel VP999 COMP-3 is?

Re: How to declare VP999 COMP-3 in easy Trieve ?

PostPosted: Mon Apr 09, 2012 3:46 pm
by sugavanesh
Its the picture clause in COBOL

Re: How to declare VP999 COMP-3 in easy Trieve ?

PostPosted: Mon Apr 09, 2012 3:48 pm
by BillyBoyo
Yes, I know that :-)

What I want to know is what you think that definition describes.

I was surprised it compiled, but it does, but I don't think it does what you think it does. If you can describe what it should be defining, we can clear that up and sort out how to define it in Easytrieve Plus.

Re: How to declare VP999 COMP-3 in easy Trieve ?

PostPosted: Mon Apr 09, 2012 4:04 pm
by BillyBoyo
Language Reference (emphasis added) wrote:P symbol
The symbol P specifies a scaling position and implies an assumed decimal point
(to the left of the Ps if the Ps are leftmost PICTURE characters; to the right of the
Ps if the Ps are rightmost PICTURE characters). The assumed decimal point
symbol V is redundant as either the leftmost or rightmost character within such a
PICTURE description.


So, to make it simple, do you have three decimal places, or four?

If three, definition should be without the P, if four, definition should be without the V.

Re: How to declare VP999 COMP-3 in easy Trieve ?

PostPosted: Mon Apr 09, 2012 5:28 pm
by sugavanesh
I have a field named

TAX-RATE VP999 COMP-3 in COBOL

Now I want to define this field in Easytrieve ... along with MASK

Re: How to declare VP999 COMP-3 in easy Trieve ?

PostPosted: Mon Apr 09, 2012 5:53 pm
by BillyBoyo
Yes. I know. I also know it is a definition in a Cobol program. I know you want to define it in Easytrieve. I know you want to also define a MASK for it in Easytrieve.

What I do not know is what your field is/what you think it is.

The V and P should not be present in the same PICture clause, although the compiler seems to just ignore the V, like the manual describes.

You have them in the same PICture clause, in a Cobol definition. So, to be able to suggest something for you in Easytrieve I need to know what the field you want actually is. You have a "questionable" Cobol definition, so I am asking you to explain, in English words nothing to do with computers, your field.

I even simplified it to asking you how many decimal places your field has, three or four.

If you don't know, you'll have to find out before going any further.

Simply repeating the same things repeatedly will lead to nothing but simple repetition of the same things.

Re: How to declare VP999 COMP-3 in easy Trieve ?

PostPosted: Mon Apr 09, 2012 7:37 pm
by BillyBoyo
Your field is two bytes long, whatever your definition.

If the P is correct, you can't represent that in Easytrieve directly, as far as I am aware.

If you need to include it in a report, you'll have to define an additional field.

Something like this:

file-field position 2 P 3
to-use-file-field file-field position 2 P 0

w-print-file-field W 5 A.
  w-always-zero w-print-file-field 1 A VALUE ZERO
  w-copy-of-file-field w-print-file-filed +1 3 N
  w-copy-of-file-field-sign w-print-file-filed +4 1 A


w-copy-of-file-field = to-use-file-field

If the file-field is less than zero, assign "-" to the new sign field, else blank or "+" as you want.