Available Operations

Some of the most common operations are listed in this section.
Note: Most operations are valid for Importing Structures as well.
Table 1. Available operations for defining import specifications
Operation name Operation description

Add nval

Adds nval (a value) to the current input.

Alpha

Converts a numerical value into an alphanumeric value; IBM® Controller converts automatically when necessary; if the value is not valid, it will be printed in the error log.

Divide By nval

Divides the current input by nval (a value)

Drop ch

Skips all characters up to the character ch EXAMPLE: operation: Drop; input: XXX;YYY output: YYY

GetItem n sep

Gets item number n from the current input with the separation character sep; can be a Trigraph symbol.

GetItemExpr

Loads the expression in a field

GetItemLoop

Loads values for each loop. The operation is displayed but can only be created using the Import Specification Wizard.

Getline n

Loads the contents of the n row from the import file.

IIF expr val1 val2

If the expression expr is true, return val1, otherwise return val2

InsertByMask chs mask

inserts the characters in chs based on mask in current input EXAMPLE: operation: InsertByMask - XX_XX_XX input: 990902 output: 99-09-02

Left Align

Left-aligns current input.

Left n

returns the first n characters from current input

Local Currency

(Not required when defining import structure specifications.)

Loads the local currency for the company code in the current input according to the company database from the company table.

Lookup lookup table on nomatch exclude/on nomatch default

Loads values from a lookup table, where input is used as a search key. The search is carried out in the From column in the lookup table. If the input is found in the From column, the value in the To column will be returned. If the input is not found in the From column, the predefined value, if defined, will be returned. Otherwise the row will be excluded when import is performed.

Lookup Factor lookup table on nomatch exclude/on nomatch default

Loads the value from the lookup tables Factor column. The search is carried out in the From column in the lookup table. If the input is found in the From column, the value in the Factor column will be returned. If input is not found in the From column, the predefined value, if defined, will be returned.

Lookup Split lookup table Split on Amount Separator

(Not required when defining import structure specifications.)

Determines the breakpoint for when a field on the Fields (2) tab should be converted to different codes, depending on the total value. Example: The account code A should remain as A if the aggregated value for account A is positive, but if the aggregated value is negative, the account code should be converted to B. Operation: Lookup Split Argument 1: X Argument 2: O Argument 3: ; Lookup table X is defined like this:

From

To

A

B; A

Lowercase

Converts input from uppercase to lowercase.

Mask mask

Carries out the opposite operation to InsertByMask.

EXAMPLE: operation: Mask XX_XX_XX input: 99-09-02 output: 990902

Multiply By nval

Multiplies current input by nval (a value).

NDropLeft n

Numeric, deletes n characters from the beginning of current input.

NDropTrailing n

Numeric, deletes n characters from the end of current input.

Num

Carries out the opposite operation to Alpha.

Pack ch

deletes all repeating characters ch from the current input string

EXAMPLE: operation: Pack C input: ACCDCECC output: ACDCEC

PaddLeft ch n

Indicates how many characters the whole string will contain and what character will be used to fill up to the left to reach this number.

PaddRight ch n

Indicates how many characters the whole string will contain and what character will be used to fill up to the right to reach this number.

Prefix str

Adds str in front of the input.

RelPeriod arg1 arg2 arg3

(Not required when defining import structure specifications.)

Operation defines the relative period for non-cumulative data. Determines the relative period based on the period in the current input, a positive integer for the offset of the period, and the offset actuality.

EXAMPLE:

The operation uses #INPUT as argument1 which is the origin used for the field RelPeriod on the Fields (1) tab. Argument2 is the offset from the period in #INPUT. For instance, an argument2 set to 1 denotes monthly data whilst an argument2 set to 3 would denote quarterly data. Argument3 is the offset actuality. The offset actuality is particularly important when dealing with incremental weekly data.

Operation: RelPeriod

Argument: #INPUT

Argument: 1

Argument: AC

Replace str1 str2

Replaces all occurrences of str1 with str2 in the input.

Reverse

Converts the string to the opposite order.

Right n

Returns the last n characters from the current input

Right Align

Right-aligns input.

Round n

Rounds the current input to n decimal places. For example, both 1.5 and 2.5 will be rounded to two.

However, note that if you open imported values in Microsoft Excel, values will be rounded according to Excel's rounding rules.

SelectIf criteria

Includes the current input if criteria is true. If the input is not included it is shown on an error report.

SkipIf criteria

Carries out the opposite function to SelectIf.

Squeeze ch

Deletes all occurrences of the character(s) ch in current input

EXAMPLE: operation: Squeeze " input: "a" "text" "where" "everything" output: a text where everything

Strip ch

Deletes all characters ch at the beginning and end of the current input.

StripLeading ch

Deletes all characters ch at the beginning of the current input.

StripTrailing ch

Deletes all characters ch at the end of the current input.

SubString n pos

Loads n characters from the pos position

SubStringExpr

Loads values in which parameters can be expressions.

SubStringLoop

Loads values for each loop. The process is displayed but can only be created using the Import Specification Wizard.

Subtract

Subtracts sequential numbers or parameters from input.

Suffix str

Adds str after the input.

Take ch

Carries out the opposite operation to Drop.

Translate Characters chr1 chr2

Translates all characters chr1 into corresponding characters in chr2 in current input.

EXAMPLE: operation: Translate Characters ¤#" odn input: L¤n#o" output: London

Uppercase

Changes input to upper case.