Comparing Decimal Numbers



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

Re: Comparing Decimal Numbers

Postby Subha » Mon Apr 07, 2008 9:47 pm

Thanks for your suggestion.
Subha
 
Posts: 6
Joined: Sat Apr 05, 2008 8:19 am
Has thanked: 0 time
Been thanked: 0 time

Re: Comparing Decimal Numbers

Postby CICS Guy » Mon Apr 07, 2008 9:49 pm

Does this come close to what you are looking for?
N1 contains five records:
0000033.32
0000041.47
0000100.01
0000050.12
0000000.02
N2 contains five records:
000000044.470
000000109.230
000000300.000
000000020.010
000000050.990
I would like to know how to compare these two files on a one to one basis and write the record with the greater variable into an Output file through Cobol program.
My expeced output will look like this:
000000044.470
000000109.230
000000300.000
0000050.12
000000050.990
CICS Guy
 
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: Comparing Decimal Numbers

Postby Subha » Tue Apr 08, 2008 8:49 pm

No the data is not preceded by zero. It is as I have mentioned. In a file layout , the numeric portion of the number is preceded by spaces and not zeros.
Subha
 
Posts: 6
Joined: Sat Apr 05, 2008 8:19 am
Has thanked: 0 time
Been thanked: 0 time

Re: Comparing Decimal Numbers

Postby dick scherrer » Tue Apr 08, 2008 9:28 pm

Hello,

In a file layout , the numeric portion of the number is preceded by spaces and not zeros.
Is there some good reason that you continue to refuse to post the data "in a file layout"? Initially, it appeared as though you had a single file with multiple numbers in it. CG posted numbers in 2 files and you commented on the format of them, but not about having 2 files.

If your next reply does not show some data records "in a file layout" (quite similar to the sample i've already given), i'll either "lock" or delete this topic. People here are willing to help you, but you have to work with us. . . :cry:
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Comparing Decimal Numbers

Postby CICS Guy » Tue Apr 08, 2008 9:48 pm

OK, trying again....
Does this come close to what you are looking for?
N1 contains five records:
     33.32
     41.47
    100.01
     50.12
      0.02
N2 contains five records:
       44.470
      109.230
      300.000
       20.010
       50.990
I would like to know how to compare these two files on a one to one basis and write the record with the greater variable into an Output file through Cobol program.
My expeced output will look like this:
       44.470
      109.230
      300.000
     50.12
       50.990

Or this:
000000044.470
000000109.230
000000300.000
0000050.12
000000050.990
CICS Guy
 
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post