Comparing Decimal Numbers
Re: Comparing Decimal Numbers
Thanks for your suggestion.
Re: Comparing Decimal Numbers
Does this come close to what you are looking for?
N1 contains five records:N2 contains five records:Code: Select all
0000033.32
0000041.47
0000100.01
0000050.12
0000000.02I 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.Code: Select all
000000044.470
000000109.230
000000300.000
000000020.010
000000050.990
My expeced output will look like this:Code: Select all
000000044.470
000000109.230
000000300.000
0000050.12
000000050.990
Re: Comparing Decimal Numbers
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.
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Comparing Decimal Numbers
Hello,
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. . .
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.In a file layout , the numeric portion of the number is preceded by spaces and not zeros.
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. . .

Hope this helps,
d.sch.
d.sch.
Re: Comparing Decimal Numbers
OK, trying again....
Does this come close to what you are looking for?
Does this come close to what you are looking for?
N1 contains five records:N2 contains five records:Code: Select all
33.32
41.47
100.01
50.12
0.02I 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.Code: Select all
44.470
109.230
300.000
20.010
50.990
My expeced output will look like this:Code: Select all
44.470
109.230
300.000
50.12
50.990
Or this:Code: Select all
000000044.470
000000109.230
000000300.000
0000050.12
000000050.990
-
- Similar Topics
- Replies
- Views
- Last post
-
- 4
- 3077
-
by sergeyken
View the latest post
Mon May 22, 2023 12:52 am
-
-
How to sum a decimal value using sort
by hkaur7087 » Thu Aug 05, 2021 2:19 pm » in DFSORT/ICETOOL/ICEGENER - 4
- 2352
-
by sergeyken
View the latest post
Thu Aug 05, 2021 7:48 pm
-
-
- 7
- 2000
-
by sergeyken
View the latest post
Wed Dec 23, 2020 6:39 pm
-
- 2
- 4130
-
by sergeyken
View the latest post
Tue Aug 02, 2022 4:07 am
-
-
Array processing and Table handling with packed decimal
by rogerstrycova » Tue Oct 26, 2021 3:55 pm » in IBM Cobol - 2
- 1711
-
by Robert Sample
View the latest post
Wed Oct 27, 2021 1:12 am
-