Many years ago I wrote a tip about how to use line commands in your own EDIT macros. Maybe you have been looking in vain for a tip on how to process the data in the line or lines marked by your line command. Well, here it comes.
The following EDIT macro compares data in two different columns (parameters FRSTCOL and LASTCOL) using the width specified in parameter COLW. If the two columns are equal the line is EXCLUDED. After execution of the EDIT macro the lines in the area marked by the line command * which has not been EXCLUDED will have different values in the two columns. If no line command has been specified the EDIT macro will scan through all lines in the data:
If you give the EDIT macro the name COMPCOL then the command COMPCOL 1 5 2 executed when the above REXX is in the data area will exclude all lines having an indentation of six spaces. Please note that instead of reporting errors when parameters are missing or wrong the REXX uses default values instead.
The important processing of the data in the EDIT session is coded in the DO WHILE loop and starts with the first line in the marked area and ends with the last line in the marked area. The number of the starting line is fetched using LINENUM .ZFRANGE and the ending line number is fetched using LINENUM .ZLRANGE. If a line command is not specified then the default of .ZFRANGE is the first line number in data and .ZLRANGE contains the last line number. The actual contens of each line is fetched using (rexxVarName = LINE lineno. Now it is up to you, your needs and your fantasy to determine how the fetched data should be processed. As I have stated before this example compares two columns and marks the result for each line by excluding some and leave other untouched. Depending on what you want to acheive, you can use other means to display the result of your processing.