/* rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : GETPROF */ /* */ /* Description : Returns the prefix being used by a user. Returns */ /* "N" if NOPREFIX is defined. */ /* */ /* Created on : 10 May 2017 */ /* Created by : KEVIN FERGUSON */ /* : Userid(MIT001) */ /* : using ABBYDALE.DEVL.REXX(GETPROF) */ /* */ /* Called by : VU, ZAPVTOC */ /* */ /* Calls : */ /* */ /* Change Activity : */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ Parse Arg Help /* Check for Help */ If SYSVAR("SYSISPF")<>"ACTIVE" then do Say "ISPF must be active to use "GETPROF exit(16) end If Help = "?" Then do Call Disp_Help exit(4) end signal on novalue /* un-initialized vars*/ signal on halt /* attention key */ Get_Prof: parse arg Prof x = Outtrap("Profile",1) "profile" if POS("NOPREFIX",profile1) = 0 then do x = POS("FIX(",profile1)+4 pr = SUBSTR(profile1,x,8) y = POS(")",pr) Prof = SUBSTR(pr,1,y-1) end else do Prof='N' end return Prof /*-------------------------------------------------------------------*/ /* Disp_Help Procedure */ /*-------------------------------------------------------------------*/ Disp_Help: Procedure say "GETPROF -" say"" say " GETPROF will return the prefix that is being used by the USERID." say " This can be used to reset the profile in a Rexx exec to what it" say " was when the Rexx exec started. If PROFILE NOPREFIX is used it " say " will return 'N' as the value." say"" say "Usage: var = GETPROF(var) or Getprof ?" say"" say" ? - Generates this information." say"" say" Return Codes :" say" 4 - Help displayed" say" 16 - Not under ISPF" say"" Return /*-------------------------------------------------------------------*/ /* End of Disp_Help Procedure */ /*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/ /* Trap NOVALUE Condition */ /*-------------------------------------------------------------------*/ novalue: say "NOVALUE entered from line" sigl say condition("D") say "The instruction is suppressed" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* Trap HALT Condition */ /*-------------------------------------------------------------------*/ halt: say "HALT acknowledged in line" sigl say "Cleanup processing in progress" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* End of GETPROF */ /*-------------------------------------------------------------------*/