CloudCheckr FinanceManager Transform Statement: option
The option
statement is used to set global parameters during the execution of a Transcript task.
Syntax
option
_option = setting
option noquote
Details
The options
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:
Option |
Default |
Notes |
continue |
|
Determines whether to proceed to the next day in a date range or bail out if an error occurs on any given day when processing a range of dates - see notes below. |
delimiter separator |
|
Specifies the delimiter character between each field in a CSV file. This character will be used when importing and exporting Datasets. The default value is a comma. If a dot character is used, then the |
services |
|
May be set to |
mode |
|
May be set to |
quote |
|
Specifies the quote character used for quoting fields in a CSV file. This character is taken into consideration when importing and exporting Datasets. When importing a Dataset, any fields that begin and end with this character will have it removed
during the import process. When exporting a Dataset, all non-blank fields will be quoted using this character. Note that when specifying a literal quote character, it must be escaped: |
noquote |
n/a |
Specifies that no quoting is to be performed either when importing or exporting Datasets. A subsequent |
loglevel |
|
Sets the logging level - see notes below |
logmode |
|
Sets the logging mode - see notes below |
overwrite |
|
May be set to |
embed |
|
May be set to |
merge_blank |
(none) |
The default value for create mergedcolumn to use if a source column is blank |
merge_nomatch |
(none) |
The default value for create mergedcolumn to use if no match is found for a regular expression in a source column value |
=
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 behavior such that if a task failure occurs then execution will resume with the next day in the range.
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
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.
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:
Level |
Details |
|
Self-diagnostic messages indicating an internal error detected with Transcript itself |
|
Non-recoverable errors, usually as a result of an Operating System error such as no available memory |
|
A transcript task error (syntax or data related) |
|
An unexpected event or a syntax error that can be recovered from |
|
Informational messages about actions performed during the execution of a transcript task |
|
Detailed logs of actions performed during the execution of a transcript task |
|
Extended debugging information (may cause very large logfiles and a minor reduction in performance) |
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.
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:
Mode |
Details |
|
After every message, the logfile is flushed to disk |
|
The logfile is not explicitly flushed to disk until the termination of the task file |
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