the values in file are :-
11.29
0.95
1.40
11.64
3.37
How to sum a decimal value using sort
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: How to sum a decimal value using sort
In order to summarize the five numeric values the best way would be - using a calculator.
No sort tool is required in this specific case.
No sort tool is required in this specific case.
Javas and Pythons come and go, but JCL and SORT stay forever.
Re: How to sum a decimal value using sort
this is just an example,I have millions of fields in file,which I want to sum up. Thanks
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: How to sum a decimal value using sort
If this was an example, then its specific numeric values are all irrelevant to your question.
What is relevant (but not mentioned in any manner):
- what are the field(s) format, and position(s)?
- what result format is expected?
Please, read ANY sort manual - especially SUM control statement, and OUTFIL TOTAL= parameter,
Then, try to run some tests ON YOUR OWN.
Then, apply your new knowledge to your original task.
Then, verify the results of your test(s).
If results are OK, then your issue is resolved.
If something goes wrong, then:
1) present to the forum ALL the code,
2) a critical portion of your input data,
3) the results produced by your test,
4) the expected results, what did you plan to get?
5) ALL and ANY error messages, produced either by JCL processing software (from SDSF), or by the SORT utility itself,
6) do not forget to use the forum’s code tags when presenting any code, or data
Good luck!
What is relevant (but not mentioned in any manner):
- what are the field(s) format, and position(s)?
- what result format is expected?
Please, read ANY sort manual - especially SUM control statement, and OUTFIL TOTAL= parameter,
Then, try to run some tests ON YOUR OWN.
Then, apply your new knowledge to your original task.
Then, verify the results of your test(s).
If results are OK, then your issue is resolved.
If something goes wrong, then:
1) present to the forum ALL the code,
2) a critical portion of your input data,
3) the results produced by your test,
4) the expected results, what did you plan to get?
5) ALL and ANY error messages, produced either by JCL processing software (from SDSF), or by the SORT utility itself,
6) do not forget to use the forum’s code tags when presenting any code, or data
Good luck!
Javas and Pythons come and go, but JCL and SORT stay forever.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: How to sum a decimal value using sort
Here is one of thousands of available examples -
https://www.ibm.com/docs/en/zos/2.1.0?topic=reports-updating-counts-totals-in-trailer-outfil
https://www.ibm.com/docs/en/zos/2.1.0?topic=reports-updating-counts-totals-in-trailer-outfil
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 2
- 4135
-
by sergeyken
View the latest post
Tue Aug 02, 2022 4:07 am
-
- 7
- 2005
-
by sergeyken
View the latest post
Wed Dec 23, 2020 6:39 pm
-
-
COBOL SORT - How to sort entire file first & sort by Key
by k_ekam » Thu Dec 01, 2022 12:58 pm » in IBM Cobol - 3
- 1557
-
by Robert Sample
View the latest post
Wed Dec 07, 2022 7:32 am
-
-
-
Array processing and Table handling with packed decimal
by rogerstrycova » Tue Oct 26, 2021 3:55 pm » in IBM Cobol - 2
- 1714
-
by Robert Sample
View the latest post
Wed Oct 27, 2021 1:12 am
-
-
- 1
- 1779
-
by prino
View the latest post
Tue Jul 02, 2024 2:23 pm