$Proc_Touch

From m204wiki
Revision as of 19:19, 16 June 2012 by JALWiccan (talk | contribs) (1 revision)
Jump to navigation Jump to search

Change a procedure's last-update date and user

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

$Proc_Touch lets you change the last updating date/time, account ID, or both, of a Model 204 procedure.

Introduced in Sirius Mods Version 6.7, $Proc_Touch is a callable function that accepts four string arguments and returns a numeric completion code.

Syntax

<section begin="syntax" /> [%result =] $Proc_Touch (filename, procname, datetime, id) <section end="syntax" />

$Proc_Touch Function

where

%result Integer that indicates the success of the function.
filename Name of file containing the procedure. If this argument is null, blank, or not specified, the current default file name is used. The file must be open.
procname Name of the procedure to be "touched," that is, whose last-updating information is to be modified.
datetime Date/time specification in either of the following formats: :lit.YYDDDHHMISSXX:elit. or YYYYDDDHHMISSXX. If YY. is used, CENTSPAN is 1975. This argument may be a date and time in the future. If this argument is null or omitted, the current date and time is used. For more information about the CENTSPAN mechanism,
id Account ID (ten-character maximum) to become the last updator. If id is not supplied, is null, or is blank, the ID of the $Proc_Touch caller is used.

This need not be the name of a valid user (this value is not validated, and it may include embedded blanks).

Besides its use internally by SirLib to set more meaningful date/time stamps, $Proc_Touch is also useful for correcting the results of Model 204 COPY PROC commands (when the old date/time is lost because OLDDATE was not specified).

These restrictions apply to a $Proc_Touch operation:

  • It must not be issued in the middle of another updating transaction.
  • It is not part of an update unit and cannot be backed out.
  • No roll-forward information is logged (or processed), so the effect of a $Proc_Touch could get lost if recovery is run.

In the following example, procedure COMP in file TESTPROC, last updated by user JACK, is "touched" to acquire an older date and user JACK3 as the last updating date and user:

Begin %RC is float OPEN FILE TESTPROC %RC = $Proc_Touch('TESTPROC', 'COMP', '200436411111111', 'JACK3') Print 'TOUCH return code is: ' %RC End

After this request finishes, the result of a DISPLAY PROC LIST command shows the modified date of the request and user JACK3 for the last update for procedure COMP:

COMP 12/29/04 11:11:11 136 JACK3

0 - Success 1 - Procedure is in use 2 - Procedure does not exist or is secured 3 - Procedure name missing 4 - File name invalid 5 - No update privileges in file 6 - Invalid touch time 7 - Invalid account ID

$Proc_Touch Error Codes


Products authorizing $Proc_Touch