Edit macro COLSUM Edit macro COLSUM Author: David McRitchie formatted on 1995/04/01 06:54 for assistance contact: D. McRitchie DMcRitchie@hotmail.com -------------------------------------------------------------------------------- Macro name. COLSUM users. PDF EDIT users type. Edit Macro resides in SYS1.TSOCLIST, and in IS03.SPF2.MACROS for use on SPF/PC -------------------------------------------------------------------------------- COLSUM Calculate the sum of specified columns within NX cc-range or label-rang e -------------------------------------------------------------------------------- Related (area of use, not of function) -- REFORMAT, REMBLANK -------------------------------------------------------------------------------- The COLSUM macro execute will total columns of NX (displayed) lines within the cc-range or label-range. -------------------------------------------------------------------------------- Since square brackets are not available, optional material is enclosed in European brackets <...>. ISREDIT COLSUM col-pair > -------------------------------------------------------------------------------- col-pair A pair of columns is required to indicate each column of num- bers to be totaled. At least one pair is required. lptr-range A pair of line pointers can be used to restrict the lines un- der consideration. The line pointers must be a labels. Spec- ifying one line pointer is invalid. The use of lptr-range is a valid substitution for a cc-range specification in this exe- cute. cc-range Use of CC...CC range over line numbers may be used in place of a lptr-range in this execute. If neither is used default range is first line through the last line. Examples COLSUM 6 10 16 20 COLSUM 31 40 COLSUM .A .B 101 116 117 122 COMMAND ===> COLSUM 5 5 10 11 =COLS> ----+----1----+----2----+----3----+----4----+----5-- CC 002 1 2 3 4 5 6 000003 2 2 3 4 5 6 CC 004 2 2 3 4 5 6 COMMAND ===> =NOTE= 10:47:28 START OF COLSUM -- NX LINES 000002 TO 000004 =COLS> ----+----1----+----2----+----3----+----4----+----5-- 000002 1 2 3 4 5 6 =NOTE> ROW TOTAL IS 5 000003 2 2 3 4 5 6 =NOTE> ROW TOTAL IS 6 000004 2 2 3 4 5 6 =NOTE> 10:47:28 SUM OF NX COLS 5-5,TOTAL IS 5 =NOTE 10:47:28 SUM OF NX COLS 10-11,TOTAL IS 12 =NOTE ROW TOTAL IS 6 =NOTE 10:47:28 -END- OF COLSUM -- NX LINES 000002 TO 000004 =NOTE 10:47:28---------------TOTAL OF SUMS IS 17 Internal Aspects Internal aspects describes how the REXX execute (or a clist) functions. This information is particularly useful to someone who may need to design a similarly functional REXX execute. It may also provide additional insight to the user. 1. The range is extracted from CC-range specification. 2. Columns are totaled, based on column pairs for the NX (displayed) lines within range. 3. The column totals themselves are totaled. 4. No NOTELINE is generated after last line, as it would interfere with subsequent use of some line ranges such as C99999. (ETR 8E852,149) n COLSUM on CSON Control Sections in DCF material marked .CS 1 on/off etc.