Edit macro PROPER Edit macro PROPER Author: David McRitchie formatted on 1995/04/01 06:54 for assistance contact: D. McRitchie DMcRitchie@hotmail.com -------------------------------------------------------------------------------- Macro name. PROPER users. PDF EDIT users particularly SCRIPT users type. Edit Macro resides in SYS1.TSOCLIST, and in IS03.SPF2.MACROS for use on SPF/PC -------------------------------------------------------------------------------- PROPER Converts selected lowercase words to have some or all capitals. -------------------------------------------------------------------------------- related @C (word-list), @CAPS, @SMALLS, LCFIX, SPELL, and perhaps @BIG S (block letters) -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- Page MACMAC-1 SYSTECH NOTICE -- CLISTS PROPER is used after the use of @SMALLS to correct capitalizations on additional words. The words have been extracted from the DCF diction- ary added words. Since PROPER has over 5000 words you may expect this execute to take a while longer than most. Optional -- you may supply your own words and ignore the builtin words. -------------------------------------------------------------------------------- Within EDIT -- COMMAND ===> PROPER (uses builtin words) Within EDIT -- COMMAND ===> PROPER Librarian SQLNO SYSIN -------------------------------------------------------------------------------- Examples including use of related clists Initial text in all uppercase COMMAND ===> 000001 THIS IS AN EXAMPLE OF TEXT CONVERTED TO LOWERCASE 000002 AFTER THE USE OF THE @SMALLS edit macro. 000003 SOME WORDS NOT CAPITALIZED INCLUDE SYSIN SYSLMOD IEBGENER IEBCOPY. Results below after using --COMMAND ===> @SMALLS 000001 This is an example of text converted to lowercase 000002 after the use of the @smalls edit macro. 000003 Some words not capitalized include sysin SYSLMOD iebgener iebcopy. Results below after using --COMMAND ===> PROPER ==NOTE 17:55:56--17:56:11 PROPER changed 3 occurrences of 3 (builtin 5276) ------ - - - - - - - -- - - - - - - - - - - - - 1 LINE(S) NOT DISPLAYED 000002 after the use of the @SMALLS edit macro. 000003 Some words not capitalized include sysin SYSLMOD IEBGENER IEBCOPY. Results below after using --COMMAND ===> PROPER sysin This is no change because sysin was in lowercase. ==NOTE 18:00:45--18:00:45 JUNKX PROPER changed 1 occurrences of 1 (list 1) ------ - - - - - - - -- - - - - - - - - - - - - 2 LINE(S) NOT DISPLAYED 000003 Some words not capitalized include sysin SYSLMOD IEBGENER IEBCOPY. Results below after using --COMMAND ===> PROPER SYSIN comparable results using --COMMAND ===> @C sysin ==NOTE 18:01:15--18:01:15 JUNKX PROPER changed 1 occurrences of 1 (list 1) ------ - - - - - - - -- - - - - - - - - - - - - 2 LINE(S) NOT DISPLAYED 000003 Some words not capitalized include SYSIN SYSLMOD IEBGENER IEBCOPY. Results below after using --COMMAND ===> RESET 000001 This is an example of text converted to lowercase 000002 after the use of the @SMALLS edit macro. 000003 Some words not capitalized include SYSIN SYSLMOD IEBGENER IEBCOPY. Examples using PROPER against a single member in EDIT using builtin words COMMAND ===> PROPER Examples using PROPER on an entire TEXT library via use of @DIR edit macro COMMAND ===> @DIR MACRO(PROPER) COMMAND ===> @DIR MACRO(PLRFIX) (see macro below) An Example of an execute invoking PROPER /* REXX -- PLRFIX Example.. */ Address "ISREDIT" "MACRO (TOKEN)" "PROPER SQLNO IEBGENER IEBCOPY FTOUTPUT" "PROPER I221 TSOPROD PROD01 CNTL REALLOC SYSIN LOGFILEs Librarian" "autosave on";"end" Internal Aspects Internals are described so that others can make up their own REXX exe- cute and understand how a particular edit macro functions -- useful for code stealing. Internal aspects describes how the MACRO (macro/exec/clist) functions. This information is particularly useful to someone who may need to design a similarly functional edit macro. It may also provide additional insight to the user. All lines are excluded and words are presented to a PROCESS procedure listed later. Preparation of input cards The text or builtin wordlist is basically the same words which were added to our DCF dictionary, except that words were checked with the SPELLING edit macro to make sure that none of these words are valid in all lowercase letters. A few of those that were valid in all lower- case letters were left in because we really want them capitalized. 1. Take words of dictionary additions 2. Remove AP and HP prefix in col 1-2 3. Change all double hyphens (--) to single hyphens (-) 4. Reformat into two columns as follows: .cm Word-A ;word-a with the left-hand side being a comment and the right side con- verted to lowercase. 5. Exclude all lines and execute SPELL. 6. Delete all excluded (or valid in lowercase) lines. 7. REFORMAT words into listing as needed below. The builtin words exist in collating order so it will not be a problem if Albert also appeared as ALBERT, since the one with the lowercase letters will have been substituted and rendered the second form unfindable when again checked for in lowercase. All lines are first excluded (EXCLUDE), a check is made to make sure that there is data, and starting time is placed in a variable to go out with ending time in a NOTELINE upon completion. PROCESS is a procedure within that actually makes the changes. PROCESS: procedure; Address "ISREDIT" a. = ""; PARSE ARG a.1 a.2 a.3 a.4 a.5 a.6 a.7 a.8 a.9 a.10 , a.11 a.12 a.13 a.14 a.15 a.16 a.17 a.18; do i = 1 by 1 while a.I /= ""; from = translate(a.i,'abcdefghijklmnopqrstuvwxyz', , 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') "change all word c"""||from||""" """||a.i||"""" end "RESET CHANGE" return The following was tried using all words in one large string, but appeared to take the same amount of time -- so staying with old. DICT had to be built with concatenation, due to 500 clause limit. limit = words(dict) do i = 1 by 1 to limit; to = word(dict,1); dict = delword(dict,1,1); from = translate(to,'abcdefghijklmnopqrstuvwxyz', , 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') "change all word c"""||from||""" """||to||""" " end ******************************************************************* n PROPER on