/********************************************************************** * EXCEPV Display Exception Views for Resources * * * * (C) COPYRIGHT IBM CORP. 1996 * * This NetView command list is provided "AS-IS" with no * * warranty provided of any kind. Use at your own risk. * * * * This command list displays a list of exception views in which a * * specified resource may be displayed if the criteria of the view * * is met (e.g., the resource has an exception status). * * * * You will need to customize the RODMNAME variable defined at the * * beginning of this EXEC. You may also want to customize the * * USER and PASSWORD variables, although the default values should * * be sufficient. * * * * Authors: David Schmidt IBM Corp. * * IBM internal e-mail: SCHMIDTD at RTPNOTES * * IBMMAIL : USIB3S6L at IBMMAIL * * INTERNET: schmidtd@raleigh.ibm.com * * Roger Adema IBM Corp. * * IBM internal e-mail: ADEMAROG at RTPNOTES * * IBMMAIL : USIB6HVZ at IBMMAIL * * INTERNET: ademarog@raleigh.ibm.com * * * * Suggestions for improvements are welcome! * * * * ------------------------------------------------------------------ * * * * INPUT: resource_name * * * * OUTPUT: A display of the exception views for which the specified * * resource is a candidate. A resource in RODM can be a * * candidate for multiple exception views and will be * * displayed on each view for which the resource matches the * * appropriate criteria. Each exception view has a set of * * criteria which must be met before the resources associated * * with that view are displayed on it. For example, an * * exception view might be defined which will only display * * resources which have an exception status and which are * * marked (i.e., the UserStatus field of the object in RODM * * has the "MARKED" bit on). The NetView for MVS V3R1 RODM * * and GMFHS Programming Guide contains a section that * * describes how exception views and their criteria are * * defines, as well as the definition of an "exception * * status". * * * * * * Change Activity: * * May 1996 David Schmidt/Roger Adema - Created command list * * * **********************************************************************/ /*********************************************************************/ /* These three variables need to be customized for your environment. */ /* We'll do the rest! */ /*********************************************************************/ /* RODMName is the name of the RODM that GMFHS uses. */ RODMName = "RODM31" /* */ /* User is the name of the RODM user authorized to connect and query;*/ /* the function Opid() will return the current NetView operator, who */ /* must be authorized to RODM. */ /* Default value: User = Opid() */ User = opid() /* */ /* Password is the password for the user above. */ /* The password N-U-L-L will make RODM attempt to connect with the */ /* name and security information of the NetView user. */ /* Default value: Password = "N-U-L-L" */ Password = "N-U-L-L" /* */ /*********************************************************************/ RC = 0 Parse Arg Parameter . Parameter = Strip(Parameter) If Parameter = "" Then Call SayMsg 1 Else Do Upper RODMName User Password PIPE_CMDLINE = 'EKGVACTM 'RODMName User Password 'UCONNECT *' /* try to connect to RODM */ Call PipeCommand RESULT Parse Var RESULT.1 Message ReturnCode ReasonCode TheRest If (ReturnCode = 0 | ReasonCode = 84) Then Do /* we connected ok or we were already connected */ If ReturnCode = 0 Then DisconnectWhenDone = 1 Else DisconnectWhenDone = 0 /* get a list of the existing exception views */ Call BuildViewNameList If RC = 0 Then Do Call FindObjects If RC = 0 Then Call GetObjects End If DisconnectWhenDone = 1 Then Do PIPE_CMDLINE = 'EKGVACTM 'RODMName User Password 'DISCONN' Call PipeCommand RESULT End End Else Call SayMsg 3 ReturnCode ReasonCode End Exit /*********************************************************************/ /* */ /* Build an array of the existing Exception Views in RODM. The */ /* array needs to contain both the MyName of the view (LONGVIEWNAME) */ /* and the ExceptionViewName (SHORTVIEWNAME) since the latter is */ /* used to actually associate an object with a view or views. The */ /* ExceptionViewList of an object (resource) contains a list of */ /* 8-byte ExceptionViewName values of the exception views for which */ /* the resource is a candidate. */ /* */ /*********************************************************************/ BuildViewNameList: PIPE_CMDLINE =, "EKGVQUEM "RODMName User "3 0 Exception_View_Class 0 * 0", "ExceptionViewName 0 10000" Call PipeCommand VIEWNAMES index = VIEWNAMES.0 Parse Var VIEWNAMES.index . ReturnCode ReasonCode . If ReturnCode <> 0 Then Do Call SayMsg 10 ReturnCode ReasonCode RC = -1 End Else Do index = 1 Do ViewLine = 5 to (VIEWNAMES.0 - 1) by 9 Parse Var VIEWNAMES.ViewLine LongViewName LongViewName = Strip(LongViewName) /* Strip off spaces */ LongViewName = Strip(LongViewName,B,'''') /* Strip off quotes */ LongViewName = Strip(LongViewName) /* Strip off spaces */ ShortViewNameLocation = ViewLine + 5 Parse Var VIEWNAMES.ShortViewNameLocation ShortViewName ShortViewName = Strip(ShortViewName) ShortViewName = Strip(ShortViewName,B,'''') ShortViewName = Strip(ShortViewName) VIEWCORR.index = ShortViewName VIEWCORR.index = VIEWCORR.index' 'LongViewName index = index + 1 End VIEWCORR.0 = index - 1 End Return /*********************************************************************/ /* */ /* Find the specified resource in RODM looking first at the */ /* DisplayResourceName field. If not found, then use the LocateName */ /* field. This may possible return multiple objects that match the */ /* specified resource name (e.g., if the specified resource name is */ /* not network qualified and resources with the same name but */ /* different networks exist in RODM). */ /* */ /*********************************************************************/ FindObjects: TwoResults = 0 /* indicate that only one LOCATE worked */ PIPE_CMDLINE = 'EKGVLOCM 'RODMName User, '1 DisplayResourceName 0 CHARVAR 50 'Parameter Call PipeCommand RESULT If RESULT.5 = "EKGV0003I End of locate." Then Do /* No DisplayResourceName... check LocateName */ PIPE_CMDLINE = 'EKGVLOCM 'RODMName User, '1 LocateName 0 INDEXLIST 50 'Parameter Call PipeCommand RESULT If RESULT.5 = "EKGV0003I End of locate." Then Do Call SayMsg 2 RC = -1 End End Else Do /* Try to find them using LocateName also */ PIPE_CMDLINE = 'EKGVLOCM 'RODMName User, '1 LocateName 0 INDEXLIST 50 'Parameter Call PipeCommand RESULTA If RESULTA.5 <> "EKGV0003I End of locate." Then TwoResults = 1 End Return /*********************************************************************/ /* */ /* Process the objects found in FindObjects. Since objects could */ /* have been found with both the DisplayResourceName and the */ /* LocateName, there may be two arrays of objects that needs to be */ /* processed. TwoResults (set in FindObjects) will be used to */ /* determine if there are two arrays of objects to be processed. */ /* */ /*********************************************************************/ GetObjects: Parse Var RESULT.2 . . . . NumObjects If TwoResults = 1 Then Do Parse Var RESULTA.2 . . . . NumObjectsA TotalObjects = NumObjects + NumObjectsA End Else TotalObjects = NumObjects Call SayMsg 6 TotalObjects Say " " Call ProcessObjects NumObjects If TwoResults = 1 Then Do Drop Result. Do goi = 0 to ResultA.0 Result.goi = ResultA.goi End Call ProcessObjects NumObjectsA End Return /*********************************************************************/ /* */ /* Process an array of objects found in FindObjects. */ /* 1. Construct the MyName (output from the RODMView command */ /* processors containing the MyName could span multiple lines).*/ /* 2. Extract the DisplayResourceName (DRN) */ /* 3. Compare the view names in the ExceptionViewList of the */ /* object against the ExceptionViewName of the view objects */ /* found in BuildViewNameList. */ /* */ /*********************************************************************/ ProcessObjects: Arg NumObj CurLine = 5 Do poi = 1 to NumObj Parse Var RESULT.CurLine . CurrentID CurLine = CurLine + 1 Parse Var RESULT.CurLine CurrentName CurrentName = Strip(CurrentName) /* Strip off spaces */ CurrentName = Strip(CurrentName,B,'''') /* Strip off quotes */ CurrentName = Strip(CurrentName) /* Strip off spaces */ CurLine = CurLine + 1 Parse Var RESULT.Curline NameSuffix . If (NameSuffix <> "(CLASSID)") & (NameSuffix <> "") Then Call TackOnSuffix Call GetDRN Call CorrelateNames CurLine = CurLine + 3 Say " " End Return /*********************************************************************/ /* */ /* Construct the MyName of an object if necessary, using multiple */ /* output lines from the RODMView command processors. */ /* */ /*********************************************************************/ TackOnSuffix: Iterations = 0 Do Until (NameSuffix = "(CLASSID)") |, (NameSuffix = "") | (Iterations > 5) NameSuffix = Strip(NameSuffix) /* Strip off spaces */ NameSuffix = Strip(NameSuffix,B,'''') /* Strip off quotes */ NameSuffix = Strip(NameSuffix) /* Strip off spaces */ CurrentName = CurrentName||NameSuffix CurLine = CurLine + 1 Parse Var RESULT.Curline NameSuffix . Iterations = Iterations + 1 End Return /*********************************************************************/ /* */ /* Extract the DisplayResourceName and class name of the resource. */ /* Convert the class name if necessary (it could be in SystemView */ /* dotted decimal format). */ /* */ /*********************************************************************/ GetDRN: PIPE_CMDLINE =, "EKGVQUEM "RODMName User "3 0 N-U-L-L 0 N-U-L-L "CurrentID, "DisplayResourceName 0 10000" Call PipeCommand RESULT2 index = RESULT2.0 Parse Var RESULT2.index . ReturnCode ReasonCode . If ReturnCode <> 0 Then Do Call SayMsg 10 ReturnCode ReasonCode RC = -1 End Else Do Do Curline2 = 6 to RESULT2.0, until (NameSuffix = "(CLASSID)") Parse Var RESULT2.Curline2 NameSuffix . End Curline2 = Curline2 + 1 Parse Var RESULT2.Curline2 '''' CurClassName '''' Call GetClassName CurClassName CnvClassName = RESULT Curline2 = Curline2 + 3 Parse Var RESULT2.Curline2 '''' CurrentDRN '''' Call SayMsg 7 CurrentDRN Call SayMsg 11 CnvClassName End Return /*********************************************************************/ /* */ /* Attempt to convert the class name of the resource. */ /* */ /*********************************************************************/ GetClassName: Parse Arg ClassName STG.0 = 4 STG.1 = 'NETVIEW MOE CNVOSI' ClassName STG.2 = 'CHOP STRING /(class)/' STG.3 = 'NOT CHOP 1 AFTER /=/' STG.4 = 'CONSOLE ONLY' Address NETVASIS 'PIPE STEM STG.', '| COLLECT', '| NETVIEW PIPE INTERPRT *', '| VAR ConvClassName' if pos('?',ConvClassName) <> 0 Then /* Class name not recognized */ ConvClassName = ClassName /* Use input class name */ Return ConvClassName /*********************************************************************/ /* */ /* Compare the list of view names in the ExceptionViewList of the */ /* object to the ExceptionViewNames of the view objects found in */ /* BuildViewNameList. Output an error message if there is more than */ /* one view found with the same ExceptionViewName (each exception */ /* view needs a unique ExceptionViewName). */ /* */ /*********************************************************************/ CorrelateNames: PIPE_CMDLINE =, "EKGVQUEM "RODMName User "3 0 N-U-L-L 0 N-U-L-L "CurrentID, "ExceptionViewList 0 10000" Call PipeCommand RESULT2 Call SayMsg 9 Do CurLine2 = 6 to RESULT2.0, until (NameSuffix = "(CLASSID)") Parse Var RESULT2.Curline2 NameSuffix . End Do CorrelateLine = (CurLine2 + 4) to (RESULT2.0 - 1) by 2 Parse Var RESULT2.CorrelateLine ShortViewName ShortViewName = Strip(ShortViewName) /* Strip off spaces */ ShortViewName = Strip(ShortViewName,B,'''') /* Strip off quotes */ ShortViewName = Strip(ShortViewName) /* Strip off spaces */ Found = 0 Do cni = 1 to VIEWCORR.0 Parse Var VIEWCORR.cni SN LN If ShortViewName = SN Then Do If Found = 1 Then Do Call SayMsg 4 SN End Found = 1 Say LN End End End If Found = 0 Then Call SayMsg 5 Return /*********************************************************************/ /* */ /* General routine to issue the PIPE, do error handling, and capture */ /* the output. */ /* */ /*********************************************************************/ PipeCommand: Arg ResultVariable STG.0 = 4 STG.1 = 'NETVIEW MOE 'PIPE_CMDLINE STG.2 = 'TOSTRING LAST 1.7 /DWO362E/' STG.3 = 'NLOCATE 1.7 /DWO362E/' STG.4 = 'CONSOLE ONLY' Address NETVASIS 'PIPE STEM STG.', '| COLLECT', '| NETVIEW PIPE INTERPRT *', '| STEM 'ResultVariable'.', '| LOCATE 1.7 .DWO369I.', '| VAR FAIL' if (symbol('FAIL') = 'VAR') then do parse var fail . . . . PipeMsg say 'Pipe message = 'PipeMsg end Return /*********************************************************************/ /* */ /* General routine to issue messages, based on the input message */ /* number. */ /* */ /*********************************************************************/ SayMsg: Parse Arg MsgNum Var1 Var2 Select When MsgNum = 1 Then Say "Please supply one parameter: the name of the resource to", "display exception views for." When MsgNum = 2 Then Say "There is no resource with that name." When MsgNum = 3 Then Say "Unable to sign on to RODM. Return/Reason codes:", Var1"/"Var2 When MsgNum = 4 Then Say "***WARNING!*** There is more than one exception view", "with the following ExceptionViewName name:" Var1 When MsgNum = 5 Then Say "No candidate exception views for this resource." When MsgNum = 6 Then Say "Number of objects located with this name:", Var1 When MsgNum = 7 Then Say "DisplayResourceName: "Var1 When MsgNum = 8 Then Say "RODM name : "Var1 When MsgNum = 9 Then Do Say "Candidate exception views:" Say "--------------------------" End When MsgNum = 10 Then Say "Unable to query for exception views. Return/Reason", "codes: "Var1"/"Var2 When MsgNum = 11 Then Say "Class: "Var1 Otherwise Say "Undefined message..." End Return