Page 2 of 2

Re: cobol salary calculation

PostPosted: Wed Dec 28, 2011 2:49 pm
by Nik22Dec
BillyBoyo wrote:if current-designation equal to previous-designation
move previous-designation to designation of next entry in table
move salary-value to salaray of next entry in table
move current-designation to previous-designation
move current-salary to salary-value
else
add current-salary to salary-value

Hi Billy,

Apologies if I am wrong but, I believe the logic which you have mentioned would start like this -

if current-designation not equal to previous-designation
move previous-designation to designation of next entry in table
move salary-value to salaray of next entry in table

Please let me know if that is not the case.

Thanks & Regards,
Nik

Re: cobol salary calculation

PostPosted: Wed Dec 28, 2011 3:09 pm
by BillyBoyo
Nik22Dec wrote:
BillyBoyo wrote:
if current-designation equal to previous-designation
    move previous-designation to designation of next entry in table
    move salary-value to salaray of next entry in table
    move current-designation to previous-designation
    move current-salary to salary-value
else
   add current-salary to salary-value

Hi Billy,

Apologies if I am wrong but, I believe the logic which you have mentioned would start like this -

if current-designation not equal to previous-designation
    move previous-designation to designation of next entry in table
    move salary-value to salaray of next entry in table


Please let me know if that is not the case.

Thanks & Regards,
Nik


You are entirely correct, the "if" in my post is missing the "not". Thanks for pointing it out, it will save confusion for others reading the topic.