/* REXX -- rewritten and converted to REXX on 1994/06/27 */ ADDRESS "ISREDIT" /* author: David McRitchie, "The REXX Macros Toolbox", 1986/05/03 TITLE: FLOC THE INCLUSIVE LINES BETWEEN TWO LABELS USERS: TSO ISPF EDIT USERS | SCRIPT USERS CONTRIBUTED: 1986/05/04 DAVID MCRITCHIE EXAMPLE: FLOC {find options} -- Normal form --- additional forms facilitate sequential usage --- --- used in support of TSO demo clist -- EDITC001 FLOC BEGIN(1) PFX(#) SFX() SET ( SET usage will not issue a find, stores begin 0) FLOC * REPEATS last SET usage FLOC adds 1 to running BEGIN count next/first OPTIONS: BASICALLY THIS IS A "FIND" COMMAND, FOLLOWED BY "LOCATE" LINES ---------------------*/ "MACRO (TOKENS)"; otokens=tokens; Address "ISPEXEC" "VGET (FLOCPFX FLOCCNT FLOCSFX)" if tokens = "" then do FLOCCNT = FLOCCNT + 1 Address "ISPEXEC" "VPUT (FLOCCNT)" tokens = "'"flocpfx||floccnt||flocsfx"'" "FIRST" zedsmsg = "End of Demo" /* as used in ===> TSO EDITC001 */ signal NormalTST end tokens = translate(tokens) i=pos('BEGIN(',tokens) if i=0 then begin="BEGIN"; else do parse var tokens left "BEGIN(" begin ")" right; tokens = left right if datatype(begin,'N') = 0 then do ZEDSMSG = "BEGIN VALUE" ZEDLMSG = ZEDSMSG "MUST BE NUMERIC" Address "ISPEXEC" "SETMSG MSG(ISRZ000)" Exit 12 END floccnt = begin i=pos('PFX(',tokens) if i /= 0 then do parse var tokens left "PFX(" flocPFX ")" right; tokens = left right end i=pos('SFX(',tokens) if i /= 0 then do parse var tokens left "SFX(" flocSFX ")" right; tokens = left right end if foptions = "SET" then do IF FLOCPFX = "" | FLOCPFX = "PFX" THEN FLOCPFX = "#" IF FLOCSFX = "" | FLOCSFX = "SFX" THEN FLOCSFX = "" IF FLOCCNT = "" | FLOCCNT = "SFX" THEN FLOCCNT = 0 end Address "ISPEXEC" "VPUT (FLOCPFX FLOCCNT FLOCSFX) SHARED" if tokens = "SET" then exit if tokens = "" then tokens = "'"FLOCPFX||FLOCCNT||FLOCSFX"'" "FIRST" else do zedsmsg = "FLOC incorrect" zedlmsg = "FLOC invalid --" tokens Address "ISPEXEC" "SETMSG MSG(ISRZ000)" exit 4 end zedsmsg = "Not Found" end NormalTST: "FIND" tokens if rc \= 0 then do zedlmsg = "FIND" tokens Address "ISPEXEC" "SETMSG MSG(ISRZ000)" exit 4 end else "LOC .ZCSR" exit 0 /* floc begin(1) set */ /* testing area Item #1. test */ /* testing area Item #2. test */ /* testing area Item #3. test */ /* testing area Item #4. test */ /* testing area Item #5. test */ /* testing area Item #11 test */ /* testing area Item #1111 test */ /* testing area Item #111 test */