$ResetN: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
m (1 revision)
(No difference)

Revision as of 18:31, 25 October 2012

Reset or view M204 parameter

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $Resetn function.

This callable function retrieves the current value of a Model 204 parameter, and it can also change the value of that parameter. Not all parameters are resettable by $Resetn: the supported subset includes only parameters considered useful to change as well as safe to change during evaluation of a User Language request.

$Resetn accepts one required and two optional arguments, and it returns a numeric value.

Syntax

<section begin="syntax" />[%oldval =] $Resetn(parameter, newval, %rc_variable) <section end="syntax" />

Syntax terms

%oldval The returned value is the current value of parameter (before $Resetn changes it). If the parameter is not the name of a parameter supported by $Resetn, the returned value is 0 (if %rc_variable is supplied; otherwise this and all errors cause request cancellation).
parameter A string that is the name of the parameter to retrieve (and optionally reset). See the list of allowed parameters in "Parameters resettable by $Resetn".
newval An optional numeric value. If specified, the parameter is reset to this value.
%rc_variable An optional %variable that is the target for the $Resetn return code. If specified, this %variable is set to one of the return codes shown below. If this argument is omitted and a condition occurs that is associated with a non-zero return code value, the request is cancelled.

This %variable may not be a Janus SOAP User Language Interface class variable.

Return codes

-1 — Invalid value for parameter 0 — Successful completion 1 — Invalid parameter name

Examples

For example, the following fragment will to prevent the M204.0620 FILE OPENED and M204.1203 FILE WAS LAST UPDATED messages from going to the user's terminal:

%VAL = $Resetn('MSGCTL', 2) OPEN 'MYFILE' PASSWORD 'UPDATE' %VAL = $Resetn('MSGCTL', %VAL)

Parameters resettable by $Resetn

In the following list of parameters, the minimum and maximum value is shown. Note that these values may be more strict than the corresponding minimums and maximums allowed by the Model 204 RESET command. For example, the RESET ERMX -2 command changes ERMX to a value, as shown by the response to the command, of 65534. However, the value of -2 is not "meaningful" for ERMX. To avoid this, an attempt to invoke $Resetn('ERMX',-2) is rejected, because -2 is outside the legal range for ERMX.

Note: This situation is even more pointed for UDDLPP, which is currently not supported for $Resetn because there's little reason to change it from within a User Language request.

The RESET UDDLPP -1 command changes UDDLPP to a value of 65535, as shown by the response to the command or as returned by $VIEW. However, the RESET UDDLPP 65535 command issues an error message and changes UDDLPP to the value of 32767, which is very different from the meaning of -1 for UDDLPP.

The valid parameter names which may be supplied as the parameter argument to $Resetn are shown in the following list, along with the minimum and maximum values and a terse description. For more information about these parameters, see the Rocket Model 204 Parameter and Command Reference, except, where indicated, a parameter is not a base Model 204 parameter but is one that is delivered with the Sirius Mods.

ENQRETRY 0..255: Number of record locking retries
ERCNT 0..65,535: Error count (provided by the Sirius Mods). (Note that the you can also increment or clear this using $ErrSet.)
ERMX -1..65,534: Maximum number of errors
FSOUTPUT 0..2: Full screen color and highlighting
HDRCTL 0..255: Header control
MBSCAN -2,147,483,647..2,147,483,647: Maximum table B to records scan
MCNCT -2,147,483,647..2,147,483,647: Maximum connect time
MCPU -2,147,483,647..2,147,483,647: Maximum CPU time
MDKRD -2,147,483,647..2,147,483,647: Maximum disk reads
MDKWR -2,147,483,647..2,147,483,647: Maximum disk writes
MOUT -2,147,483,647..2,147,483,647: Maximum output lines
MSGCTL 0..255: Message printing options
MUDD -2,147,483,647..2,147,483,647: Maximum USE dataset lines

Some of the parameters supported by $Resetn are treated as "hexadecimal" parameters by the Model 204 RESET command. For example, the VIEW HDRCTL command displays a result such as X'01'. It so happens that this is a moot point with any of these "hex" parameters currently supported by $Resetn, because the maximum value they may have is 7, which is the same in base 10 and base 16.

However, if $Resetn is extended to support, for example, UDDRFM, you might wish to supply an argument to $Resetn expressed in hex. This could be easily accomplished using the $X2D function. Again, assuming $Resetn were extended to support UDDRFM, you could set the USE dataset record format to variable length records with ASA carriage control with the following statement:

%VAL = $Resetn('UDDRFM', $X2D('12'))

See also

Products authorizing $Resetn

Products authorizing $ResetN