Edit macro SORTEM Edit macro SORTEM Author: David McRitchie formatted on 1995/04/01 06:54 for assistance contact: D. McRitchie DMcRitchie@hotmail.com -------------------------------------------------------------------------------- Macro name. SORTEM users. SCRIPT users type. Edit Macro resides in SYS1.TSOCLIST -------------------------------------------------------------------------------- SORTEM of words sorted horizontally -- useful in SCRIPT List -------------------------------------------------------------------------------- related DUADD SCRIPT ".du add" sorted and reflowed -------------------------------------------------------------------------------- The edit macro SORTEM creates a horizontally sorted word list from a word list. Duplicate words are removed and lines are reflowed so that each line is made ap- proximately the same length. -------------------------------------------------------------------------------- ISREDIT SORTEM {flow} ISREDIT SORTEM {flow length} ISREDIT SORTEM {lptr-range} ISREDIT SORTEM {lptr-range flow length} -------------------------------------------------------------------------------- Options: flow option default is 70 e.g. ===> SORTEM 70 The resulting sorted word list will fit within the column specified. length of all words will be 10 e.g. ===> SORTEM 70 10 The length of words in the list will be at least this length. The default is the length of the longest word encountered. required labels .sortf.label required at beginning of a contiguous word list section. .sortx.label required immediately after the end of the contig- uous word list section. This convention permits the group consist of a single line, and the retention of of both labels for immediate reuse. Examples SORTEM The default flow option of 70 will be used. All words in the word list will be realigned from the required line labels ".SORTF" through the line before the re- quired line label ".SORTX". The default length of each word will be ten. SORTEM 75 The specified flow option of 75 will be used. All words in the word list will be realigned from the required line labels ".SORTF" through the line before the re- quired line label ".SORTX". The default length of each word will be ten. SORTEM 75 12 The length of each word will be 12. SORTEM .A .B 75 12 The specified flow option of 75 will be used. All words in the word list will be realigned from the required .SORTF label specified as ".A" through the line before the required .SORTX label specified as ".B". The length of each word will be 12. Before use of SORTEM EDIT --- xxxx.xxxx.xxxx(xxxxxx) - 01.32 --------------- columns 001 124 COMMAND ===> sortem .sortf SORTF CCCCC BBBBB AAAAA DDDDD EEEEE ZZZZZ FFFFF YYYYY 000005 AA AA AA AA ZZ BB YY CC XX DD WW BB YY 000006 AAAA BBBBB CCCCCCC DDDDD EEEEEE FFFFF GGGGG .sortx SORTX BBBBB CCCCCCC DDDDD EEEEEE FFFFF GGGGG 000008 XXXXXX XXXXXX XXXXXXX XXXXXXX XX XXX XX XXX XX XXX After use of SORTEM and a "RESET" EDIT --- xxxx.xxxx.xxxx(xxxxxx) - 01.32 --------------- sortem FINISHED OK COMMAND ===> .SORTF AA AAAA AAAAA BB BBBBB 000005 CC CCCCC CCCCCCC DD DDDDD 000006 EEEEE EEEEEE FFFFF GGGGG SORTF 000007 WW XX YY YYYYY ZZ 000008 ZZZZZ .SORTX SORTX BBBBB CCCCCCC DDDDD EEEEEE FFFFF GGGGG 000010 XXXXXX XXXXXX XXXXXXX XXXXXXX XX XXX XX XXX XX XXX Internal Aspects: 1. Verifies that pointers .SORTF and .SORTX exist and that .SORTF is first. 2. A new pointer named .sortl is created for the line before .SORTX If this pointer would be same as .sortf, then .sortf will first be duplicated after itself. 3. A new line is created by reproducing .sortl and labelling as .sortr; retain- ing data before column 9, it will serve to terminate text flow. 4. Repeats the .sortl line creating .sortr to aid in text flow 5. Separates each word so each appears on one line 6. Sorts between .SORTF and .sortl 7. Removes duplicates .SORTF and .sortl (may result in loss of .sortl line) invokes ISREDIT REMDUPS .SORTF .sortl 8. Text flow to 70 columns unless otherwise entered e.g. SORTEM 75 9. Removes "³" previously added with change all .SORTF .sortl '³' ' ' 10. Removes temporary line at .sortr Potential Problems: Assuming data does not contain "|", and that ASCII data does not include x'f0' through x'F9' because am using these characters for some transformations. Changes for SPF/PC: Had to recover line labels when lines are rewritten and when TFLOW is used. A far cry from TSO usage.