Previous Topic: 9.4.2.1.2 @Control Panel Driver Routine

Next Topic: 9.4.2.3 VMTPARM1 - Subordinate Action Routine

9.4.2.2 VMTPARMS - Field Edit/Action Routine


+----------+
| VMTPARMS | Field Edit/Action Routine
+----------+

The VMTPARMS routine provides special support functions for
the VMTDSP routine.  Four major functions are performed:

    1.  EDIT - Verify entered data for syntax and logical
        consistency.

    2.  SAVE - Save a data group to the VMTXMIT File.

    3.  GET - Get a data group from the VMTXMIT File; or if
        not yet defined, then set default values.

    4.  ACTION - Carry out an action function, such as
        editing a file of JCL, or refreshing a screen of
        data.


VMTPARMS is called using the format

    rc = VMTPARMS(function,id,name,data)

At a minimum, all calls to VMTPARMS must include the function
and ID.  Valid values for function are indicated above.  The
ID indicates the parameter group on which this function is to
be performed.  The values for ID are MAIN, COMMON, ACCOUNT,
MONITOR, MONXA, POWER, NETDATA, PRINT and AUTHTAB.

The "name" parameter is only used for EDIT function codes
and contains the name of the data field to be edited.

The "data" parameter contains the data value to be edited in
an EDIT function or the action data for an ACTION function.

The Id entered is used to obtain the suffix node for the
field names containing information pertinent to the parameter
group and function.  After routine initialization of data
variables, the appropriate function routine is called, and
control is then returned to the caller by exiting with a
return code.


FUNCTION ROUTINES, SUPPORTING SUBROUTINES

GetData          Called when a GET function is requested
                 externally, or when an ACTION function calls
                 for either DEFAULT setting of parameter
                 values, or REFRESH of previously defined
                 parameter settings.  If a DEFAULT parameter
                 setting is requested, the routine clears all
                 variables in memory.  Otherwise, the last
                 setting of parameter values is read into
                 memory.  Then, based on the parameter group
                 to be processed, data fields are assigned
                 values (either the default, or the most
                 recent specification).

                 Parameters (entry)     -   Parameter group
                 identifier.

                 Returns - The return code is always 0.

SaveData         Called when a SAVE function is requested
                 externally.  The first parameter argument
                 identifies the parameter group to be updated
                 and is used to create the list of fields to
                 update.  The second parameter argument
                 contains the suffix node for the field names
                 of the parameter group.  The "last update"
                 field is set with the current date and time,
                 and the fields are written back to the
                 GLOBALV group VMTXMIT using PUTP.

                 Parameters (entry) - Parameter group
                 identifier; group node suffix.

                 Returns - Return code from GLOBALV PUTP.

EditData         Called when an EDIT function is requested
                 externally.  The first parameter argument
                 identifies the parameter group from which
                 this data field originates.  EditData does
                 not use this.  The second parameter argument
                 contains the name of the data field to be
                 edited, and the third parameter argument
                 contains the data value for the field.  The
                 data field "name" is used to construct a
                 function subroutine name of the form
                 'Edit.name' to be called on the fly (using
                 an INTERPRET REXX command).

                 Except for a check of input or output
                 medium, if the data verifies correctly, it
                 is assigned to the field being checked.  For
                 input or output mediums, not only is the
                 data value (FILE, SPOOL, or MONWRITE)
                 assigned to the appropriate field, but
                 special variables used internally by the
                 transfer program are also assigned a medium
                 type for the file (e.g.  RDA or OSI).

                 Parameters (entry) - Parameter group
                 identifier; field name; data value entered
                 for field.

                 Returns - return code from edit subroutine

DoIt             Called when an ACTION function is requested
                 externally.  Valid action functions are
                 EDIT, DEFAULT, and REFRESH.  When DEFAULT or
                 REFRESH is specified, the GetData routine is
                 called with the appropriate parameter group
                 specification and the keyword parameter
                 DEFAULT or REFRESH.  When the EDIT action is
                 chosen, subroutine FileEdit is invoked.

                 Parameters (entry) - Parameter group
                 identifier; Edit/Action parameters.

                 Returns - XEDIT return code or 0.

FileEdit         Called from the DoIt subroutine to edit a
                 SELECT or JCL file.  The necessary file
                 name, type, and model are constructed.
                 XEDIT is invoked using the VMTPARM1 profile,
                 passing along the parameter group identifier
                 and the other parameters supplied by the
                 caller.

                 Parameters (entry) - Parameter group
                 identifier, parameters for XEDIT macro
                 VMTPARM1.  Group node suffix.

                 Returns - XEDIT return code; 2 if there is a
                 parameter problem.

Edit.  routines  Edit routines exist for each data field.
                 The names for the routines are in the form
                 EDIT.field_name.  Field names ending with a
                 node of A relate to VM Account data
                 specifications.  Field names ending with M
                 are VM Monitor data specifications, and
                 field names ending with MX are XA Monitor
                 data specifications.  The following edit
                 routines are provided:

                 Edit.RSCS         Validate RSCS userid
                 Edit.XFR2.A       Validate transfer userid
                 Edit.XFR2.C       Validate transfer userid
                 Edit.Node         Validate target NJE node
                                   name
                 Edit.WtrUsr       Validate Account data
                                   userid when data has been
                                   preprocessed
                 Edit.Class        Validate spool class
                 Edit.Mode.A       Validate data transmission
                                   mode
                 Edit.Src.A        Validate data source
                 Edit.Mode.C       Validate data transmission
                                   mode
                 Edit.Mode.MX      Validate data transmission
                                   mode
                 Edit.Src.C        Validate data source
                 Edit.Src.MX       Validate data source
                 Edit.Comp.A       Validate data compression
                                   (yes/no)
                 Edit.Comp.C       Validate data compression
                                   (yes/no)
                 Edit.Comp.MX      Validate data compression
                                   (yes/no)
                 Edit.Sel.A        Validate record selection
                                   (yes/no)
                 Edit.Sel.C        Validate record selection
                                   (yes/no)
                 Edit.Sel.MX       Validate record selection
                                   (yes/no)
                 Edit.Hold         Validate hold spool files
                                   (yes/no)
                 Edit.WtrD         Validate display response
                                   (yes/no)
                 Edit.WtrW         Validate wait for avail
                                   files (yes/no)
                 Edit.Arch.A       Validate archiving input
                                   data (yes/no)
                 Edit.Arch.C       Validate archiving input
                                   data (yes/no)
                 Edit.Arch.MX      Validate archiving input
                                   data (yes/no)
                 Edit.Dplx.A       Validate duplexed output
                                   data (yes/no)
                 Edit.Dplx.C       Validate duplexed output
                                   data (yes/no)
                 Edit.Dplx.MX      Validate duplexed output
                                   data (yes/no)
                 Edit.Sel.fn.A     Validate file name select
                                   file
                 Edit.Sel.ft.A     Validate file type select
                                   file
                 Edit.Sel.fm.A     Validate file mode select
                                   file
                 Edit.Jcl.fn.A     Validate file name JCL
                                   file
                 Edit.Jcl.ft.A     Validate file type JCL
                                   file
                 Edit.Jcl.fm.A     Validate file mode JCL
                                   file
                 Edit.Jcl.fn.C     Validate file name JCL
                                   file
                 Edit.Jcl.ft.C     Validate file type JCL
                                   file
                 Edit.Jcl.fm.C     Validate file mode JCL
                                   file
                 Edit.Sel.fn.C     Validate file name select
                                   file
                 Edit.Sel.ft.C     Validate file type select
                                   file
                 Edit.Sel.fm.C     Validate file mode select
                                   file
                 Edit.Jcl.fn.MX    Validate file name JCL
                                   file
                 Edit.Jcl.ft.MX    Validate file type JCL
                                   file
                 Edit.Jcl.fm.MX    Validate file mode JCL
                                   file
                 Edit.Sel.fn.MX    Validate file name select
                                   file
                 Edit.Sel.ft.MX    Validate file type select
                                   file
                 Edit.Sel.fm.MX    Validate file mode select
                                   file

Chk.Medium       Validates the medium specified for input and
                 output files.  This routine is called by the
                 various Edit routines for the data
                 transmission mode and data source.  It uses
                 a specially defined table of one-byte medium
                 identifiers, which is then indexed into
                 tables based on the value specified for the
                 mode or source (FILE, SPOOL, or MONWRITE),
                 operation (INPUT, OUTPUT, ARCHIVE OR
                 DUPLEX), and parameter group processed
                 (ACCOUNT, MONITOR, or MONXA).

                 If an invalid specification has been made,
                 VMTMsg is called with error code 9.
                 Otherwise, the data field is assigned the
                 value chosen and an internal variable for
                 transfer is assigned, indicating the medium
                 to be used.

                 Parameters (entry) - Data value specified,
                 data field name, and operation specified.

                 Returns  -  return code of 0 indicates no
                 problem; other values indicate otherwise.

Chk.YN           Validates parameters that have a Y (yes) or
                 N (no) specification.  Any other value will
                 cause a call to VMTMsg with an error code
                 of 7.

                 Parameters (entry) - Data value specified,
                 and error message category.

                 Returns - return code of 0 indicates no
                 problem; other values indicate otherwise.

Chk.Set          Not used at this time.

Chk.SpoolClass   Verifies that the Spool reader class is a
                 valid specification.  Chk.SpoolClass is
                 called by routine Edit.Class.  It checks to
                 see if the specified class is A-Z, 0-9, or
                 *.  If not, VMTMsg is called with error code
                 33.  Otherwise, the return code is set to 0.

                 Parameters (entry) - Data value specified,
                 I.

                 Returns - return code of 0 indicates no
                 problem; other values indicate otherwise.

Chk.Fileid       Verifies that a correct CMS file name has
                 been specified.  This routine is called by
                 the various Edit routines established to
                 check each part of a file identifier (i.e.,
                 file name, type, and mode).  Based on the
                 name of the data field (passed as the second
                 entry parameter), Chk.Fileid determines
                 which part of the file identifier is being
                 processed.

                 If the mode is being processed, it is
                 checked for a length of two or less, and
                 valid characters A-Z or     *  in the first
                 column.  If the first character is A-Z or *,
                 and the length is two, a check is made for
                 the mode number 0-6.  For the other parts of
                 the identifier, the data is checked for
                 valid CMS file name characters.  If a file
                 fails the checks outlined, VMTMsg is called
                 with error code 12.

                 Parameters (entry) - Data value specified,
                 data field name.

                 Returns - return code of 0 indicates no
                 problem; other values indicate otherwise.

Chk.Userid       Called by the Edit.RSCS, Edit.XFR2.A, and
                 Edit.XFR2.M routines to validate a userid if
                 specified.  A check is first made to see if
                 a userid is specified.  If not, no value is
                 assigned to the data element, and a return
                 code of zero is issued.  Otherwise, the
                 userid is validated by spooling a device to
                 it.  If this is successful, the userid is
                 assigned to the data field value, and a
                 return code 0 is returned.  If the spooling
                 is unsuccessful, VMTMsg is called with a
                 error code of 13.

                 Parameters (entry) - Data value specified,
                 data field name.

                 Returns - return code of 0 indicates no
                 problem; other values indicate otherwise.