Comparing Decimal Numbers
Posted: Sat Apr 05, 2008 8:37 am
Hi,
I have to compare two decimal numbers.The two numbers are taken from an Input file.
Iam reading these two input variables into a group variable. If the number is 32.33 and 42.47(the second number in the input file is followed by 2 spaces), the following is the declaration.
Eg:
03 input number1
05 num1 Pic S9(7)
05 dec Pic X(1)
05 num2 Pic V99
03 input number2
05 N1 Pic S9(9)
05 D Pic X(1)
05 N2 Pic V999
I would like to know how to compare these two variables and write the greater variable into an Output file through Cobol program.
I have to compare two decimal numbers.The two numbers are taken from an Input file.
Iam reading these two input variables into a group variable. If the number is 32.33 and 42.47(the second number in the input file is followed by 2 spaces), the following is the declaration.
Eg:
03 input number1
05 num1 Pic S9(7)
05 dec Pic X(1)
05 num2 Pic V99
03 input number2
05 N1 Pic S9(9)
05 D Pic X(1)
05 N2 Pic V999
I would like to know how to compare these two variables and write the greater variable into an Output file through Cobol program.