View previous topic :: View next topic
|
Author |
Message |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Hi All,
I am having a issue while comparing the sum of below fields with hundred.
Cobol definination
PARTICIPATION-PERCENT S99V9999 ZD 211 216 6
PRINT-PERCENT REDEFINES PARTICIPATION-PERCENT
S9(4)V9 ZD 211 215 5
I need to check whether the total of the percent is 100 or not.How should I define this fields in ezt? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you start over and post what is actually happening and if you want to mention "Cobol definition" post the cobol definitions. The posted "fields" look like neither cobol nor Easytrieve.
What "issue" are youhaving?
Simply said, Easytrive will let you compare a numeric literal of 100 (or some working data field with a value of 100) against some other field that is the sum of the fields you want to use. . . |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
I copied it from file manager.
THe COBOL definition is
10 PARTICIPATION-PERCENT PIC S99V9999.
10 PRINT-PERCENT
REDEFINES PARTICIPATION-PERCENT
PIC S9(4)V9.
I have to sum this. So, I declared in ezt
WS-TOTAL W 6 N
WS-PER W 6 N -----> above mentioned field
Logic
WS-TOTAL= WS-TOTAL +WS-PER
IF WS-TOTAL NE 100000
PUT OUTFILE.
It is not working.:-( |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
It is not working.:-( |
As has been mentioned many, many times - do NOT post "it didn't work". This is a complete waste of time.
The redefinition could cause problems as the fields are not the same length.
The compare is comparing one hundred thousand. . .
The Easytrieve definitions are not the same as the cobol definitions. . . |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Try the following :
Code: |
WS-TOTAL W 6 N 2
WS-PER W 6 N 2
|
|
|
Back to top |
|
|
|