IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how can i move 1.20 to numeric data type statically


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vnbabu.au

New User


Joined: 11 Dec 2006
Posts: 2
Location: chennai,india

PostPosted: Tue Dec 12, 2006 5:41 pm
Reply with quote

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
View user's profile Send private message
Rajen

New User


Joined: 05 May 2005
Posts: 61

PostPosted: Tue Dec 12, 2006 6:50 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Dec 12, 2006 6:59 pm
Reply with quote

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
View user's profile Send private message
vnbabu.au

New User


Joined: 11 Dec 2006
Posts: 2
Location: chennai,india

PostPosted: Wed Dec 13, 2006 6:28 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Dec 13, 2006 6:39 pm
Reply with quote

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
View user's profile Send private message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Thu Dec 14, 2006 10:55 am
Reply with quote

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
View user's profile Send private message
Rajen

New User


Joined: 05 May 2005
Posts: 61

PostPosted: Thu Dec 14, 2006 1:06 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top