View previous topic :: View next topic
|
Author |
Message |
vnbabu.au
New User
Joined: 11 Dec 2006 Posts: 2 Location: chennai,india
|
|
|
|
i have one application. in that, i need to calculate
salary=designation code *hours worked * incentive factor.
incentive factor = 1.00 for 1st quarter,
= 1.10 for 2nd quarter
= 1.20 for 3rd quarter
= 1.30 for 4th quarter
how can i move these to incentive factor.
there is limitation in value claus and also in 'move statemeent; |
|
Back to top |
|
|
Rajen
New User
Joined: 05 May 2005 Posts: 61
|
|
|
|
Hi vnbabu,
You can define variable for Incentive Factor as
WS-INCENTIVE-FAC PIC 9(3)v9(2).
Now based on Quarter value (1st,2nd,3rd,4th) you move 1.00,1.10,1.20,1.30 to this variable.
This variable will take 5 bytes. you can increase/decrease picture clause value based on your requirement.
Let me know if it worked or not.
Thanks,
Rajen. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi
Quote: |
there is limitation in value claus and also in 'move statemeent |
Could u plz explain on wat ur limitation is
Thanks
Arun |
|
Back to top |
|
|
vnbabu.au
New User
Joined: 11 Dec 2006 Posts: 2 Location: chennai,india
|
|
|
|
o.k, thanks rajen.
but i get soc7 abend as i us that icentive factor in arithmetic operation.
how can i over come.
Rajen wrote: |
Hi vnbabu,
You can define variable for Incentive Factor as
WS-INCENTIVE-FAC PIC 9(3)v9(2).
Now based on Quarter value (1st,2nd,3rd,4th) you move 1.00,1.10,1.20,1.30 to this variable.
This variable will take 5 bytes. you can increase/decrease picture clause value based on your requirement.
Let me know if it worked or not.
Thanks,
Rajen. |
|
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
How is the "incentive factor" being loaded with the "1.00" and what is the definition of "salary", "designation code", "hours worked" and "incentive factor"? |
|
Back to top |
|
|
sankar_MF
New User
Joined: 19 Sep 2006 Posts: 29
|
|
|
|
Hi vnbabu,
If you declare the Incentive factor as 9(3)99, as Rajen said, it won't abend.It will work fine. can u please check once again.
Thanks
Sankar |
|
Back to top |
|
|
Rajen
New User
Joined: 05 May 2005 Posts: 61
|
|
|
|
Hi vnbabu,
You got soc7 abend as i us that icentive factor in arithmetic operation.
This might have happened because you are trying to add Incentive Factor to some variable which not of the proper picture clause.
Remember when you declare
Code: |
WS-INCENTIVE-FAC PIC 9(3)v9(2). |
It takes only 5 bytes.
Can you please give us defination of the other variable which you are using for the arithmetic operation.
If possible give us arithmetic operation also.
I guess the problem is when you are giving values (Result valuyesin your case) to other variable (Let say WS-SUM-INCENTIVE) , the receiving variable might not be of correct data type.
Thanks,
Rajen Patel. |
|
Back to top |
|
|
|