How to declare VP999 COMP-3 in easy Trieve ?



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

How to declare VP999 COMP-3 in easy Trieve ?

Postby sugavanesh » Mon Apr 09, 2012 3:22 pm

Could anyone tell me, how to declare VP999 COMP-3 in easy trieve and how to declare MASK for this field ?
sugavanesh
 
Posts: 9
Joined: Sat Nov 05, 2011 9:03 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Mon Apr 09, 2012 3:28 pm

Can you describe in words what you feel VP999 COMP-3 is?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby sugavanesh » Mon Apr 09, 2012 3:46 pm

Its the picture clause in COBOL
sugavanesh
 
Posts: 9
Joined: Sat Nov 05, 2011 9:03 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Mon Apr 09, 2012 3:48 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby BillyBoyo » Mon Apr 09, 2012 4:04 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby sugavanesh » Mon Apr 09, 2012 5:28 pm

I have a field named

TAX-RATE VP999 COMP-3 in COBOL

Now I want to define this field in Easytrieve ... along with MASK
sugavanesh
 
Posts: 9
Joined: Sat Nov 05, 2011 9:03 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Mon Apr 09, 2012 5:53 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby BillyBoyo » Mon Apr 09, 2012 7:37 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post