/* rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : ONLY */ /* */ /* Description : The ONLY macro will display only lines containing */ /* the passed string. */ /* It is based on the ONLY CLIST that is contained in */ /* in file 454 of the Share tape but it has been */ /* Rexxed. */ /* */ /* Created on : 29 Mar 2018 */ /* Created by : KEVIN FERGUSON */ /* : Userid(MIT001) */ /* : using ABBYDALE.XFER.EMACS(ONLY) */ /* */ /* Called by : */ /* */ /* Calls : */ /* */ /* Change Activity : */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ Address ISREDIT "MACRO (FNDPARM)" signal on halt /* attention key */ if fndparm ="" then do zedsmsg = "No search string" zedlmsg = "NO Paramemter passed. Please retry" Address ISPEXEC "SETMSG MSG(ISRZ001)" rc = 8 exit (rc) end Address ISREDIT "(RECFM) = RECFM" /* Get record format */ Address ISREDIT "(NUMMODE,NUMTYPE) = NUMBER" /* Get NUM MODE INFO*/ sysdval = numtype /* NUMBER RETURNS A STRING*/ Parse var sysdval STD COBOL DISPLAY /* PARSE NUMTYPE INTO ITS 3*/ . If nummode="ON" then do If recfm = "V |" cobol="COBOL" then do ISREDIT "(LEFTON,RIGHTON) = BOUNDS" /* NOTE THE CURRENT*/ ISREDIT "NUMBER OFF" /* THIS MAY CAUSE THE LEFT*/ ISREDIT "(LEFTOFF,RIGHTOFF) = BOUNDS" /* NOTE WHERE THE BOUNDS*/ If leftoff=1 then do lefton = /* BLANK THE VALUES TO BE*/ righton = /* RESTORED TO CAUSE*/ If recfm="V" then do ISREDIT "BOUNDS = 9 *" /* OVERRIDE THE LEFT TO*/ end else do If std="STD" then do ISREDIT "(LRECL) = LRECL" ISREDIT "BOUNDS = 7" eval(lrecl-8) /* OVERRIDE BOTH*/ End Else do ISREDIT "BOUNDS = 7 *" /* FOR NOSTD OVERRIDE ONLY*/ End End End End End sysscan = 1 /* stop substitution of & in search string */ Address ISREDIT "SCAN OFF" ISREDIT "SEEK" fndparm "FIRST" /* seek the for the string */ If rc=0 then do ISREDIT "EXCLUDE ALL" /* Hide the lines */ ISREDIT "FIND" fndparm "ALL" /* Show line with string */ rc = 0 End Else Do zedsmsg = "STRING NOT FOUND" sysscan = 2 /* Rescan for &STR() for clists */ zedlmsg = """"fndparm""" NOT FOUND IN THE ENTIRE FILE" Address ISPEXEC "SETMSG MSG(ISRZ001)" /* Sound the alarm.*/ rc = 12 End If nummode = "ON" & "("recfm = "V |" cobol="COBOL)" Then Do /* IF NUMBER WAS TURNED*/ ISREDIT "NUMBER = (NUMMODE,NUMTYPE)" /* OFF, TURN IN BACK ON AND*/ ISREDIT "BOUNDS =" lefton righton /* RESTORE THE BOUNDS.*/ End Exit (rc) Exit 0 eval: Procedure Return arg(1) /*-------------------------------------------------------------------*/ /* Trap HALT Condition */ /*-------------------------------------------------------------------*/ halt: say "HALT acknowledged in line" sigl say "Cleanup processing in progress" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* End of ONLY */ /*-------------------------------------------------------------------*/