option

Overview

The option statement is used to set global parameters during the execution of a Transcript task.

Syntax

optionoption = setting

option noquote

Details

The option statement can be used multiple times within the same task script and always takes immediate effect. It is therefore possible (for example) to import a CSV file delimited with commas and quoted with single quotes, change the options and then export it with semicolon delimiters and double quotes.

The supported options are as follows:

When using options, there must be whitespace on each side of the = sign

Additional notes

Continue

option continue = yes|enabled

option continue = no|disabled

When executing a task file repeatedly against each day in a date range, by default Transcript will abort the whole run if a task failure occurs. In cases where this is undesirable, setting the continue option to enabled or yes (both work in exactly the same way) will change the behaviour such that if a task failure occurs then execution will resume with the next day in the range.

When combining the continue option with option mode = permissive it is possible to process a range of dates for which usage or other data is not available, because the mode option will prevent a failed import statement from being treated as a fatal error.

Delimiter / Separator

When specifying a quote or tab as the separator it is necessary to escape it in order to prevent Transcript from interpreting it as a meaningful character during the parsing of the task script. For example:

option delimiter = \t # Specify a literal TAB character
option delimiter = \" # Specify a literal quote

Services

This option may be specified as readonly , overwrite or update and influences the behaviour of the service and services statements as follows:

Any services that are overwritten through use of option overwritewill lose any custom rates associated with them and a single default rate will be created instead.

In all cases, rate revisions may be created depending on the data being processed, but existing global rates will not be replaced with new ones if the effective date of the updated service matches that of an existing global revision.

Execution mode

option mode = strict
option mode = permissive

Transcript supports two modes of execution for tasks:

  • In strict mode, if an error is encountered at any point in the task, the error will be logged and execution will terminate

  • In permissive mode, many errors that would otherwise have caused the task to fail will be logged, the statement that caused the error will be skipped and execution will continue from the next statement in the task.

The mode option can be used multiple times and changed at any point during task execution. This means that specific sections of the task can be more error tolerant.

Errors that can be handled in permissive mode are mainly syntax errors or those involving invalid parameters to Transcript statements. There are error conditions that can arise during the execution of a statement will cause the task to fail even in permissive mode.

Log levels

Transcript generates a considerable amount of logging information during the execution of a task. The loglevel option can be used to increase or decrease the level of detail written to the logfile. All logging levels must be specified in UPPER CASE. The following levels can be set:

The order of the logging levels in the table above is significant, in that for any given level, all levels above it in the table are also in effect. Therefore a logging level of WARN will result in log entries for ERROR, FATAL, and INTERNAL level events, as well as warnings.

The loglevel option can appear multiple times within a transcript task and will take immediate effect whenever it is used. This means that within a task, the loglevel can be increased for certain statements and reduced for others.

Regardless of the logging level, some events will always create a logfile entry, for example the success or failure of a transcript task at the end of its execution.

Log mode

In order to minimise the effect on performance when logging, Transcript opens the logfile when it is first run and then holds it open until the completion of the task being executed. The logfile can be accessed in one of two modes:

The default is SAFE. It is not recommended that this be changed.

Examples

The following Transcript task will import a CSV file quoted with double quotes and delimited with commas and then export a copy with semicolons as delimiters and quoted with single quotes:

It also increases the logging level for the import statement

option quote = \"
option loglevel = DEBUGX
import usage from Azure
option loglevel = INFO
option separator = ;
option quote = '
export azure.Usage as c:\transcript\exported\azure_modified.csv

Last updated