EDIT REXX execute CHECKDUP EDIT REXX execute CHECKDUP Author: David McRitchie formatted on 1995/04/01 06:54 for assistance contact: D. McRitchie DMcRitchie@hotmail.com -------------------------------------------------------------------------------- Edit macro CHECKDUP users. PDF EDIT users particularly SCRIPT users type. Edit Macro resides in SYS1.TSOCLIST, and in IS03.SPF2.MACROS for use on SPF/PC -------------------------------------------------------------------------------- CHECKDUP Check for repeated, duplicated, words -------------------------------------------------------------------------------- related EDITCHEK, EDITOL, FIXQUOTE, PERIOD, PLICHK, REMDUPS -------------------------------------------------------------------------------- A frequent typing error is to repeat the word typed at the end of a line again at the beginning of the next. This is hardly noticeable until a document is reformatted. SCRIPT does not provide a warning that the same word has been used twice in a sentence. In the PC world text editors will check this for you. CHECKDUP will check for duplicate words in a row. Repeated words will be indicated regardless of whether they appear in the same sen- tence, or at the end of one sentence and the beginning of the next sentence. Words will be checked for repeating regardless of letter case; the the repeated word will be indicated as found. Some words will not be shown to be repeated words they include: "END", "GT", "HP", "SK", and "ZCSR". The words "A" and "I" will not be found by this edit macro because it is not a prefix. Other clists useful for checking SCRIPT are EDITCHEK, EDITPR, EDITOL, PERIOD, and PLICHK. -------------------------------------------------------------------------------- ISREDIT CHECKDUP (no operands) -------------------------------------------------------------------------------- Examples CHECKDUP Internal Aspects Internal aspects describes how this REXX execute functions. This in- formation is particularly useful to someone who may need to design a similarly functional REXX execute. It may also provide additional in- sight to the user. 1. No changes to the content will be made. 2. All lines are excluded from the display. 3. Lines are examined to find the first letter prefixed word. This line is held in dataname RECORD, which is translated to remove punctuation. **when subsequent words fail to turn up on a line the process will restart here to find the next line**. The begin- ning of the word is recorded as COL1. 4. The ending is found by searching the same card for the NEXT blank character. 5. Once a word is located. The following process takes place. a. The space is recorded as COL2. The word (THATWORD) includes the trailing space until processed with the WORD function. b. THISWORD is copied from THATWORD, and translated to capitals. c. THISWORD is compared to the LASTWORD. If equal a noteline will be generated using THATWORD which has not been trans- lated. Certain words will be excluded from this comparison -- END, GT, SK, and ZCSR. d. LASTWORD is copied from THISWORD. e. A check is made using ISREDIT for the next prefix word on the same line. Processing continues at item 4., if another prefix is found, or at item 3., if there are not more word prefixes on the same line.