System block variables

System block variables provide an easy way to reference specific information about the system, the data being worked on, and the active user's session, among other useful pieces of information.

While the 1010data Macro Language allows you to define your own block variables, there are system block variables that are defined for you. System block variables are relevant in the scalar context and are introduced, like other block code variables, with @. Howcver, system block variables have a _ suffix to differentiate them from regular block code variables.

The following is a list of system block variables may be referenced in block code.

System block variable Description
@accum_mach_ Internal designation of server on which accum is running.
@accum_port_ Internal designation of port number for accum handling data.
@basetable_ The table on which a query was invoked and/or the base table if a simple <base> was used before the rest of the query.
Note: Using the <base> tag in a <block> will not change the current value of @basetable_. @basetable_ only makes sense in the simplest of queries and should probably be avoided. Use with caution.
@browser_type_ The name of the browser in use by the current session.
@browser_version_ The version of the browser in use by the current session.
@dbm_version_ The DBM version in use by the current session.
@gmtoffset_ The user's preferred time zone with Daylight Saving Time (DST) taken into account

@gmtoffset_ provides a correction to GMT in the U.S. that takes into account DST (as observed in NYC).

Available as of version 10.14.

@lastlogin_ A decimal value (in date+time form) of the login date and time for the current user's last session (adjusted with @gmtoffset_).

Available as of version 10.14.

@logindate_ An integer value (in date form) of the login date for the current user's session (adjusted with @gmtoffset_).
@logindatetime_ A decimal value (in date+time form) of the login date and time for the current user's session (adjusted with @gmtoffset_).
@logintime_ An integer value (in time form) of the login time for the current user's session (adjusted with @gmtoffset_).
@now_ The current date and time in Julian date format (adjusted with @gmtoffset_).
Note: Avoid using @now_ in a <materialize> operation.
@origtable_ Path of the table first used at the beginning of a query. Use with caution.
@origtitle_ The name/path of the originating table.
@queryhash_ A text value representing the hash value of the current query.
@sid_ The session ID of the current session.
@site_ The name of the environment the query code is running in. For example, if the environment is NJPROD, @site_="nj", and in the MBS Azure Cloud environment, @site_="mbs".
@specialhash_ A text value representing the special hash value.
@subtitle_ The subtitle of the current table if present, otherwise returns na. Use with caution.
@suffix_ The text value appended to the names of all real columns in the base table, as supplied by the suffix attribute to the <base> operation.
Note: The suffix_ variable has been deprecated. Do not use for new Macro Language code. Use the params_ variable to identify base suffixes and apply them as needed.
@timezone_ An integer value representing the user's preferred time zone.
@title_ The title of the current table. Use with caution.
@today_ The current date (adjusted with @gmtoffset_).
@username_ Username of user logged into current session.
@verdate_ The date that the version of the current session was released.
@version_ The version of 1010data in use by the current session.
@versioninfo_

The following system block variables are used only within particular scalar contexts.

Table 1. Within block code used in <dynamic>
System block variable Description
@instid_ Used to identify multiple instances of the same QuickApp.
@tag_ The number of the current tag.
Table 2. When rendering a QuickApp through the web target
System block variable Description
@qaid_ The QuickApp ID.
Table 3. Within <do>
System block variable Description
@doerr_ This variable is set to the error message.
@errdo_ This variable is set to the name associated with the <do> clause in which the error occurred.
Table 4. Within Macro Language code processed under the SQL engine
System block variable Description
@params_ A package containing constant parameter values (literals, such as numbers and strings), keyed on the parameter name. For non-literal expressions, the value is not available in params_. Instead, use sqlvalues_.

PARAMS(('foo','abc'),('bar','3.14'))

In the PARAMS package above, @params_.foo will contain the literal abc, but @sqlvalues_.foo will contain the MDB expression for the string. @params_.bar will contain the literal 3.14 but @sqlvalues_.bar will contain the MDB expression that yields that number.

@sqltypes_ Contains the SQL types for the values in sqlvalues_.
@sqlvalues_ Contains MDB expressions corresponding to SQL expressions. sqlvalues_ provides a convenient way of passing SQL columns into macro code.
@worksheet_ Use within SQL Macro Language code to refer to the current worksheet (the operations preceding the SQL block).