cobol salary calculation



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: cobol salary calculation

Postby Nik22Dec » Wed Dec 28, 2011 2:49 pm

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
Thanks,
Nik
User avatar
Nik22Dec
 
Posts: 68
Joined: Mon Dec 26, 2011 6:38 pm
Has thanked: 2 times
Been thanked: 0 time

Re: cobol salary calculation

Postby BillyBoyo » Wed Dec 28, 2011 3:09 pm

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

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post