As a follow up on the tip in week 37/2011 I will show you an EDIT macro, which I have named SUMCOL and use fairly often. The idea is to create a sum of all numeric values in a selected column of data. The final sum is displayed in an ISPF message.
The EDIT macro must scan a column, which is specified as a starting and ending position. If the characters between the starting position and the ending position is a numeric value, the value is added to the sum. The lines contributing to the sum are marked using the line command *. If no * line command is specified all lines in data are used as input.
The above EDIT macro makes my worklife so much easier when I have entered ISPF EDIT or VIEW on some data, where I need to calculate the sum of some numbers presented in a part of the lines or on all lines in data. The error processing may fall a little behind compared to your normal standards as most input errors will just result in a display of a sum of 0. I am pretty convinced you can do better than that.
I have often thought of a way to improve the above macro in order to make it sum many columns at the same time and to display sums after breaks in data, but I have failed so far. If you come up with a good idea or already have made something similar, I would like to hear from you.