SET command

Sets a configurable Analytics option.

Note

The SET command sets an Analytics option for the duration of the Analytics session only. This behavior applies whether you use the SET command in the Analytics command line or in an Analytics script.

To set Analytics options so that they persist between Analytics sessions, you must use the Options dialog box. Only a subset of options are available in the Options dialog box. For more information, see Configuring Analytics options.

 

SET BEEP SET LEARN SET READAHEAD
SET CENTURY SET LOCKAUTOSAVEFILE SET RETRY
SET CLEAN SET LOG SET RETRYIMPORT
SET DATE SET LOOP SET SAFETY
SET DELETE_FILE SET MARGIN SET SEPARATORS
SET DESIGNATION SET MATH SET SESSION
SET ECHO SET MONTHS SET SORTMEMORY
SET EXACT SET NOTIFYFAILSTOP SET SUPPRESSTIME
SET FILTER SET NOTIFYRETRYATTEMPTS SET SUPPRESSXML

SET FOLDER

SET NOTIFYRETRYINTERVAL SET TEST

SET FORMAT

SET ORDER SET TIME
SET FUZZYGROUPSIZE SET OVERFLOW SET UTCZONE
SET GRAPH SET PASSWORD SET VERIFY
SET HISTORY SET PERIODS SET WIDTH
SET INDEX SET PICTURE  

Syntax

Syntax

Examples and remarks

SET BEEP value

SET BEEP 2

Default setting: 0

Specifies the number of beeps to sound when command processing is completed.

The value parameter must be between 0 and 255. Specifying 0 turns off the beep.

Options dialog box: Interface options

SET CENTURY value

SET CENTURY 40

Default setting: 40

Specifies the start-of-century year for two-digit years.

The value parameter must be from 0 to 99.

Setting the start-of-century value to 40 means that two-digit years 40 to 99 are interpreted as 1940 to 1999, and two-digit years 00 to 39 are interpreted as 2000 to 2039.

Options dialog box: Date and Time options

SET CLEAN {ON | OFF}

SET CLEAN ON

When this option is turned on, Analytics replaces invalid character data with blanks and invalid numeric data with zeros.

SET DATE <TO> {0 | 1 | 2 | string}

SET DATE "YYYY/MM/DD"

Default setting: MM/DD/YYYY

Specifies the display format for dates, and the date portion of datetimes, in views, reports, and exported files.

  • 0 Sets the date to MM/DD/YYYY format.

  • 1 Sets the date to MM/DD/YY format.

  • 2 Sets the date to DD/MM/YY format.

  • string Sets the date to the custom format you specify.

    When using the SET DATE command to specify custom date formats, you must use 'D' for Day, 'M' for Month, and 'Y' for Year, even if you have specified different date format characters in the Options dialog box. For example:

    SET DATE "DD MMM YYYY"

Options dialog box: Date and Time options

SET DELETE_FILE {ON | OFF}

SET DELETE_FILE ON

Default setting: OFF

Controls whether the data file (*.fil) associated with a table layout is automatically deleted when you delete the table layout.

  • ON The associated data file is automatically deleted.

  • OFF The associated data file is not deleted.

Caution

Use caution when turning this option on. It may be an original data file that is deleted along with the table.

Data files are deleted outright. They are not sent to the Windows Recycle Bin.

You must include the underscore ( _ ) in DELETE_FILE.

Specifying SET DELETE_FILE, without any parameter, in the command line displays whether DELETE_FILE is currently on or off.

Options dialog box: Table options

SET DESIGNATION value

SET DESIGNATION "Produced by ABC Corporation"

The value parameter is a quoted string that specifies the label to display at the top of each printed page.

Options dialog box: View options

SET ECHO {ON | NONE}

SET ECHO NONE
COMMENT Commands and results in scripts are excluded from the log.
SET ECHO ON

Controls whether commands and results in scripts are saved to the Analytics command log.

  • ON Commands and results in scripts are saved to the command log.

  • NONE Commands and results in scripts are not saved to the command log.

Note

The SET ECHO command applies only to the logging of commands and results in scripts. Commands performed through the Analytics user interface or issued from the command line, and any results they produce, are always logged, regardless of how ECHO is set.

Specifying SET ECHO, without any parameter, in the command line displays whether the logging of commands and results in scripts is currently on or off.

SET EXACT {ON | OFF}

SET EXACT ON

Default setting: OFF

Controls how Analytics compares character fields, expressions, or literal values.

Note

Blank spaces are treated like characters.

  • ON Comparison strings must be exactly identical to be a match. When comparing two strings of unequal length, Analytics pads the shorter string with trailing blank spaces to match the length of the longer string.

    For example, "AB" is equal to "AB", but it is not considered equal to "ABC".

  • OFF Analytics uses the shorter string when comparing two strings of unequal length. The comparison starts with the leftmost characters and moves to the right.

    For example, "AB" is equal to "AB", and it is also considered equal to "ABC".

For more examples illustrating SET EXACT, see "Exact Character Comparisons" in Table options.

You can use the ALLTRIM( ) function to remove leading and trailing blank spaces and ensure that only text characters and internal spaces are compared.

For example: ALLTRIM(" AB") = ALLTRIM("AB") is True when the values are wrapped with ALLTRIM( ), but False otherwise.

Some Analytics commands and functions are affected by SET EXACT and some are not:

Affected Not affected
  • LOCATE command
  • MATCH( ) function
  • BETWEEN( ) function
  • JOIN command
  • DEFINE RELATION command
  • FIND( ) function
  • FINDMULTI( ) function

Options dialog box: Table options

SET FILTER <TO> {test | filter_name}

SET FILTER TO ProdNo = "070104347"
SET FILTER TO ProdNoFilter

Creates a global filter (view filter) on the open table, and specifies either a logical test, or the name of an existing saved filter.

Specifying SET FILTER, without any parameter, removes any filter from the open table.

SET FOLDER folder_path

SET FOLDER /Tables/Results

Specifies the Analytics project folder in the Overview tab for command output. The default output folder is the folder containing the active table.

This a DOS-style path using the format /foldername/subfoldername, in which the initial slash (/) indicates the root level in the Overview tab. You must specify a full file path.

  • SET FOLDER /Tables/Results sets the output folder to the Results subfolder. If the Results subfolder does not exist, it is created.

  • SET FOLDER / sets the output folder to the root level in the Overview tab

  • SET FOLDER sets the output folder to the default (the folder containing the active table)

The output folder remains as whatever you set it – until you reset it, or close the project. Upon opening the project, the output folder reverts to the default of the active table folder.

SET FORMAT {ON | OFF}

SET FORMAT ON

Default setting: OFF

Controls whether Analytics automatically displays the current table layout and computed field definitions when you open a new table.

  • ON The current table layout and computed field definitions are automatically displayed. The results are also saved in the command log.

  • OFF The current table layout and computed field definitions are not displayed.

Options dialog box: Table options

SET FUZZYGROUPSIZE <TO> num

SET FUZZYGROUPSIZE TO 10

Default setting: 20 items

Specifies the maximum number of items that can appear in a fuzzy duplicate group in the output results. The num parameter cannot be less than 2 or greater than 100. The specified size remains in effect for the duration of the Analytics session.

SET GRAPH type

SET GRAPH LINE

Specifies the graph type to use for all subsequently generated graphs. The commands run must be compatible with the specified graph type. For example, the BENFORD command cannot produce a PIE2D or PIE3D chart. If an incompatible graph type is specified the default graph type is used (BAR3D).

The type parameter must be one of the following:

  • PIE2D

  • PIE3D

  • BAR2D

  • BAR3D – This is the default graph type.

  • STACKED2D

  • STACKED3D

  • LAYERED

  • LINE

  • BENFORD – Combines 2D bar graph and 2D line graph.

SET HISTORY <TO> value

SET HISTORY TO 50

Specifies the maximum number of table history entries to retain. The value parameter must be between 1 and 100.

SET INDEX <TO> value

SET INDEX TO "CustomerCode.INX"

Specifies the index to apply to the active table.

SET LEARN <TO> script

SET LEARN TO InventoryRec

Specifies the name of the script file that the Script Recorder uses to record commands.

SET LOCKAUTOSAVEFILE {ON | OFF}

SET LOCKAUTOSAVEFILE ON

Default setting: OFF

Specifies the mechanism for saving data to the Analytics log file (*.LOG).

  • ON Log data is saved directly to disk, without using a write buffer.

    Saving log data directly to disk, without using a write buffer, can help prevent corruption of the log file when complex scripts run and potentially conflict with other processes on your computer such as anti-virus monitoring or automated backups.

    Note

    Specifying ON may cause Analytics to run slower. Use this option only if you have issues with log file corruption.

  • OFF Log data is saved to a write buffer before being saved to disk.

    The write buffer is an temporary data storage location that provides faster access than the hard disk drive and therefore overall faster execution of Analytics scripts.

SET LOG <TO> {file | OFF}

SET LOG TO "analysis.log"
SET LOG OFF

The first command switches logging to the specified log. If the specified log does not exist, it is created.

The second command restores logging to the original Analytics command log.

Note

The maximum length of an Analytics project path and log name is 259 characters, which includes the file path, the log name, and the file extension (.log).

SET LOOP <TO> num

SET LOOP TO 100

For records processed by the LOOP command, specifies the maximum number of commands that can be executed for any single record.

The num range is 0 to 32767. Specifying 0 turns off the limit on command executions per record.

Caution

If you specify 0 you risk a script entering an infinite loop. A best practice is to always specify a SET LOOP limit.

How command executions per record are calculated

For a specific record, the number used to compare against the SET LOOP maximum is the total of all commands in the GROUP-LOOP block that processes the record. The command breakdown is shown below.

Tip

To understand how the total number of commands for a record are calculated, you can manually count the commands, line by line, in a GROUP-LOOP block. Start with the GROUP command and finish with the END command that terminates the GROUP command.

When you get to the LOOP command, you need to account for the number of times that the loop iterates for a particular record. See the command breakdown below for details.

Remember that variable assignments are commands. The optional ASSIGN command keyword is often omitted.

Comments are also commands (COMMENT).

Commands in a GROUP-LOOP block Count
GROUP command, terminated by END command 2
ELSE IF and ELSE statements

1 for each occurrence preceding the ELSE IF or ELSE block in which the record is processed

1 for the ELSE IF or ELSE block in which the record is processed

Each command inside GROUP . . . END, or inside the ELSE IF or ELSE block in which the record is processed

Does not include LOOP . . . END, or any of the commands contained in the loop.

Equal to the number of commands in the group, or in the ELSE IF or ELSE block, not including the loop

(LOOP command + the number of commands inside LOOP . . . END) x (the number of loop iterations for the record)

Does not include the END command that terminates the LOOP command.

Equal to the product of the loop commands times the number of loop iterations for the record
A final execution of the LOOP command that evaluates to False 1
The END command that terminates the LOOP command 1

SET MARGIN side <TO> value

SET MARGIN TOP TO 100

Default setting: 51 (51/100 of an inch)

Specify LEFT, RIGHT, TOP, or BOTTOM for the side parameter. If you want to change the margin on all sides, you need to specify each margin with a separate SET MARGIN command. Specifying a value of 100 creates a margin of 1 inch.

Options dialog box: Print options

SET MATH <TO> {FIRST | LAST | MIN | MAX}

SET MATH TO MIN

Default setting: MAX

Specifies how decimal precision works when two operands are evaluated in a numeric expression.

  • FIRST use the number of decimal places of the first operand in a pair of operands
  • LAST use the number of decimal places of the last operand in a pair of operands
  • MIN use the minimum number of decimal places in a pair of operands
  • MAX use the maximum number of decimal places in a pair of operands

In multi-operand expressions, the SET MATH setting works on a pairwise basis, applying the specified setting to each pair of operands, rounding as necessary, as they are evaluated in the standard mathematical order (BOMDAS).

If the SET MATH setting reduces the number of decimal places in a result, the result is rounded, not truncated.

For more information, see Controlling rounding and decimal precision in numeric expressions.

Note

You cannot use SET MATH while an Analytics table is open.

SET MONTHS <TO> string

SET MONTHS "Ene,Feb,Mar,Abr,May,Jun,Jul,Ago,Set,Oct,Nov,Dic"

Specifies the default three-character abbreviations for month names. The string parameter is the list of month abbreviations separated by commas.

Options dialog box: Date and Time options

SET NOTIFYFAILSTOP {ON | OFF}

SET NOTIFYFAILSTOP ON

Default setting: OFF

Controls script behavior if the NOTIFY command fails.

  • ON Script processing stops, with a message to the log, if a NOTIFY command in the script fails. The script stops after the initial failure, or after the specified number of NOTIFYRETRYATTEMPTS, if none of the attempts are successful.
  • OFF Script processing continues even if a NOTIFY command in the script fails.

Options dialog box: Command options

SET NOTIFYRETRYATTEMPTS <TO> num

SET NOTIFYRETRYATTEMPTS TO 10

Default setting: 5 attempts

Specifies the number of times the NOTIFY command will attempt to send an email if the initial attempt is unsuccessful. Enter a number from 0 to 255. If you enter 0, no additional attempts are made after an initial failure.

One possible reason for the NOTIFY command failing to send an email is that the email server is unavailable.

Options dialog box: Command options

SET NOTIFYRETRYINTERVAL <TO> seconds

SET NOTIFYRETRYINTERVAL TO 30

Default setting: 10 seconds

Specifies the amount of time in seconds between NOTIFYRETRYATTEMPTS. Enter a number from 1 to 255.

Options dialog box: Command options

SET ORDER <TO> values

SET ORDER TO aAbBcC...
SET ORDER

Default setting: system default

Specifies the sort sequence for character fields. The values parameter lists all the characters for the specified sort order.

The second command returns the sort sequence to its system default setting.

For more information, see The Sort Order option and sort sequences .

SET OVERFLOW {ON | OFF}

SET OVERFLOW OFF

Default setting: ON

Controls script behavior if a numeric overflow occurs.

  • ON Script processing stops, with a message to the log, if a numeric overflow occurs.

  • OFF Script processing continues even if a numeric overflow occurs.

Options dialog box: Numeric options

SET PASSWORD num <TO> string

SET PASSWORD 1 TO "password123"

Creates a password definition, and specifies a password value, for unattended script execution.

The num parameter uniquely identifies the password definition and must be a value from 1 to 10. Specify the password value as a quoted string.

Caution

The SET PASSWORD command exposes an actual password in clear text in a script, which may not be appropriate for your situation. As a more secure alternative, you can use the PASSWORD command to prompt for a password at the beginning of script execution, and temporarily and securely stored the password value in memory.

SET PERIODS <TO> value <,...n>

SET PERIODS TO "0,30,90,180,10000"

Default setting: 0,30,60,90,120,10000

Specifies the default aging periods used by the AGE command.

Options dialog box: Date and Time options

SET PICTURE format

SET PICTURE "(9,999,999.99)"

Default setting: -999999.99

Specifies the default formatting for numeric values.

Options dialog box: Numeric options

SET READAHEAD <TO> buffer_size

SET READAHEAD TO 100

Default setting: 33 kilobytes

Specifies the size of the data block read (data buffer) in kilobytes. Enter a number from 5 to 255. You should only change this setting if you are advised to do so by Support.

Options dialog box: Table options

SET RETRY <TO> num

SET RETRYIMPORT <TO> num

SET RETRY TO 20

Default setting: 0 attempts

Specifies the number of times Analytics attempts to execute a command if the initial attempt is unsuccessful. Enter a number from 0 to 255. If you enter 0, no additional attempts are made after an initial failure.

There is a 1 second waiting period between retry attempts.

The ability to specify retry attempts is useful when connecting to databases or cloud data services, which can be temporarily unavailable. Retrying a command can also help if you encounter issues with writing data to disk, or reading data from disk.

SET RETRY applies to the following commands:

ACCESSDATA DIRECTORY INDEX SAMPLE
AGE DUPLICATES JOIN SAVE
APPEND EVALUATE LIST SEQUENCE
BENFORD EXPORT MERGE SIZE
CLASSIFY EXTRACT OUTLIER SORT
CLUSTER FUZZYDUP PREDICT STATISTICS
CROSSTAB FUZZYJOIN RANDOM STRATIFY
CVSPREPARE HISTOGRAM RCOMMAND SUMMARIZE
CVSSAMPLE GAPS REFRESH TRAIN
CVSEVALUATE IMPORT REPORT VERIFY

Note

SET RETRYIMPORT is retained for backward compatibility. SET RETRYIMPORT and SET RETRY perform identical actions.

Options dialog box: Command options

SET SAFETY {ON | OFF}

SET SAFETY OFF

Default: ON

Controls whether a confirmation dialog box appears before overwriting any of the following items:

  • fields in table layouts

  • Analytics tables

  • files, including Analytics data files (*.fil)

  • ON A confirmation dialog box appears and you must specifically confirm overwriting.

  • OFF No confirmation dialog box appears and overwriting is performed automatically.

Specifying SET SAFETY, without any parameter, in the command line displays whether SAFETY is currently on or off.

Options dialog box: Interface options

SET SEPARATORS <TO> values

SET SEPARATORS TO ".,,"

Specifies the default decimal, thousands, and list separators used by Analytics. The SET SEPARATORS values must be three valid separator characters in the following order:

  • decimal (period, comma, or space)

  • thousands (period, comma, or space)

  • list (semi-colon, comma, or space)

Among the three separators, the decimal separator must be unique. You must specify all three separators when you use the command. The list separator is used primarily to separate function parameters.

Options dialog box: Numeric options

SET SESSION <session_name>

SET SESSION
SET SESSION "Analysis"

Creates a new session in the Analytics command log. The session is identified by the current timestamp.

The optional session_name allows you to add up to 30 characters of additional identifying information. Quotation marks are permitted but not required.

SET SORTMEMORY num

SET SORTMEMORY 800

Default setting: 0

Specifies the maximum amount of memory allocated for sorting and indexing processes. The num parameter must be a value from 0 to 2000 megabytes (MB), to be entered in 20MB increments. If the sort memory is set to 0, Analytics uses the memory currently available.

Options dialog box: Table options

SET SUPPRESSTIME {ON | OFF}

SET SUPPRESSTIME ON

Default setting: OFF

Controls whether Analytics suppresses the time portion of datetime source data.

Note

This setting is only for use when defining an Analytics table that uses an ODBC data source (IMPORT ODBC command), or direct database access (DEFINE TABLE DB command).

  • ON When defining the table, Analytics suppresses the time portion of datetime values. For example, 20141231 235959 is read, displayed in views, and subsequently processed as 20141231.

    Including this command in a pre-datetime Analytics script (pre v.10.0) that assumes the time portion of datetime data will be truncated allows the script to run in the datetime-enabled version of Analytics.

    Analytics suppresses the time portion by using only the date portion of the datetime format. The time data is still present in the *.fil file or the database table. If required, you can redefine the field or define a new field to include the time portion of the data.

  • OFF Analytics tables defined using ODBC or direct database access include full datetime values.

You can issue the SET SUPPRESSTIME ON/OFF command in a script or from the command line.

Specifying SET SUPPRESSTIME, without any parameter, in the command line displays whether the suppression of the time portion of datetime data is currently on or off.

SET SUPPRESSXML {ON | OFF}

SET SUPPRESSXML ON

Default setting: OFF

Controls whether command output to screen appears as plain text or formatted text.

  • ON Command output to screen appears as plain text.

  • OFF Command output to screen appears as formatted text.

Specifying SET SUPPRESSXML, without any parameter, in the command line displays whether the setting is currently on or off.

Options dialog box: Command options

SET TEST {ON | OFF}

SET TEST ON

Default setting: ON

Controls whether the results of IF, WHILE, FOR, and NEXT tests associated with GROUP commands are recorded in the log.

  • ON The results are recorded in the log.

  • OFF The results are not recorded in the log.

Options dialog box: Command options

SET TIME <TO> string

SET TIME "hh:mm:ss PM"

Default setting: hh:mm:ss PM

Specifies the display format for the time portion of datetimes, and standalone time values, in views, reports, and exported files.

When using the SET TIME command to specify time formats, you must use 'h' for Hour, 'm' for Minute, and 's' for Second, even if you have specified different time format characters in the Options dialog box. For example:

SET TIME TO "hh:mm"

Options dialog box: Date and Time options

SET UTCZONE {ON | OFF}

SET UTCZONE OFF

Default setting: ON

Controls the display of time data that includes a UTC offset. UTC is Coordinated Universal Time, the time at zero degrees longitude.

  • ON Time data with a UTC offset displays as the UTC equivalent of the time.
  • OFF Time data with a UTC offset displays without conversion to UTC.

For example:

  • 01 Jan 2015 04:59:59 ( SET UTCZONE ON )
  • 31 Dec 2014 23:59:59-05:00 ( SET UTCZONE OFF )

Note

Conversion of times to UTC is for display purposes only, and does not affect the source data. You can change back and forth between the two different display modes whenever you want to.

Options dialog box: Date and Time options

SET VERIFY {ON | OFF | BLANK}

SET VERIFY BLANK

Default setting: OFF

Controls automatic verification of data whenever a table is opened, or a field in the table is processed by a command.

  • ON Analytics automatically verifies whether the contents of a data field correspond to the field's data type in the table layout. In the table view, affected fields display ### ERR ###. Data processing stops if an error is encountered.

  • OFF No automatic data verification.

  • BLANK Analytics replaces invalid character data with blanks and invalid numeric data with zeros, in addition to the verification described for the ON parameter. Data processing continues if an error is encountered and the error is captured in ERROR.LOG in the Analytics project folder.

Options dialog box: Numeric options

SET WIDTH <TO> characters

SET WIDTH TO 20

Default setting: 12

Specifies the default display width in characters for numeric computed fields or ad hoc numeric expressions when Analytics cannot determine the maximum width.

Options dialog box: Numeric options