You are here: Field Rules Reference > Field Rules Summary > Move_It

Move_It

Use this field level rule to move text from an extract record to the output buffer. This rule supports overflow. The format mask can contain these options:

Format

Description

B

Used for mapping a large data buffer with more than 1024 bytes into a multiline text field.

In flat file (non-XML) extract data, the size of the data buffer is limited to the value in the MaxExtRecLen option in your INI file.

Here is an example, based on mapping data from an XML extract file:

;0;0;FIELD;0;1024;FIELD;0;1024;B;move_it;!/

descendant::My_Extract_Data/

FIELD.xml();N;N;N;N;3715;2899;11010;

C

Centers the data.

D

Converts the data returned by the rule into lowercase.

F

Converts to sentence style where the first character is capitalized and the remaining characters are lowercased.

G

If you include this flag, the system always returns the data at the source length and ignores the destination length.

If you omit the G flag, the Move_It rule returns data truncated to either the source or destination length, whichever is shorter.

For instance, if you use the Move_It rule with a source length of 20 and a destination length of 19, including the G flag returns 20 characters. Omitting the G flag returns 19 characters.

If you include the ChkDestLenExceeded option in the RunMode control group and set the option to Yes, the system reports any occurrence where the destination length is less than the source length.

L

Left justifies the data.

K

Removes leading and tailing spaces.

N

Searches for the next record in the transaction list instead of starting with the first record. For example, assume the current transaction has five records (A, B, C, D, and E) and the last record processed is C. If the next rule is Move_It and it has the N flag set, the D record will be searched instead of starting at the top (record A). When you include the Move_It rule and you are using overflow (@UserFuncName options) do not use the N flag.

R

Right justifies the data (for non-proportional fonts only).

SR

Same record flag. This flag is similar to the N (next record) flag except it assumes the data is in the record returned by the previous Move_it rule.

Note that SR only applies to the prior execution of a Move_It rule. You must have at least one Move_It rule without the SR flag before you can add a Move_It rule which uses this flag.

T

Include this flag to format the text in title case. This flag tells the system to capitalize the first letter in each word in the string and lowercase the rest of the letters in each word. See the Specifying Title Case - Example for more information.

U

Converts the data returned by the rule into uppercase.

$

A string proceeded by a dollar sign ($) is used as a sprintf format for the output data.

8

Indicates the extract data for this field is stored in UTF-8 format. UTF-8 (Unicode Transformation Format, 8-bit encoding form) is a format for writing Unicode data in text files. See Mapping Data Section in Unicode Reference Guide for more information.

Blank

Default, trims trailing spaces.

Notes

For example, if a K flag occurs first, the system clips the heading and tailing spaces and then formats the string. If a K flag occurs second in the format string, the system formats the string and then clips the heading and trailing spaces.

You can do some interesting things by handling the flags in sequence, you can clip (K) the input data, format ($) the string, right justify (R) the result, and format ($) it again.

On the other hand, you can do some things that don't make sense, like center justify (C) the data and then clip (K) the result. This sequence negates the center justification. The same applies to right (R) and left justification (L) if you put a K in the format afterwards.

Furthermore, what order would you expect R, C, and L applied especially when mixed with the format ($)? Just like the clip flag (K), if you right justify (R) first and then format ($), you will likely get different results than if you format ($) first and then right justify (R).

Note If you apply this rule to a multiline variable field, make sure destination length is greater than one (1). Otherwise, no data will be mapped. This happens because when you create a multiline variable field, its length is zero (0) and its destination length is also set to zero. While some rules, such as the Mk_Hard rule, map data even if the destination length is zero, the Move_It rule will not.

Handling currency symbols

Let’s assume you have variable fields that represent amounts. The extract data is pre-formatted as character text (left justified), which represents the correct currency format. Unfortunately, the extract data does not include the currency symbol. You have to add the currency symbol.

Depending on the nationality, the currency symbol can appear at the beginning of the amount, like the dollar sign, or it can appear at the end of the amount, such as FF for French Francs.

Beginning with version 10.0, you can use a format of K,$%sFF to add the currency symbol.

The K would come first to indicate the space before and after the input data should be removed, then FF would be appended.

So K,$%sFF is not the same as $%sFF,K. The former clips the input data before the format is applied. The latter clips the data after the format has been applied.

For currency symbols that appear at the beginning of the data, such as British pound sterling, you could use the Move_It rule with a format mask of $£%s. This works because trailing spaces are trimmed. For currency symbols at the end of the data, this will not work.

User functions

The Move_It rule supports the use of @UserFuncName functions. User functions let you move data from the source record to the output buffer based on the outcome of a user-defined function. User functions and their parameters are specified in the data field before the search criteria.

Specifying Title Case - Example

Here is an example of how you can specify the T (title case) format flag in an extract dictionary definition.

Add the T format flag in the Mask field. Be sure to separate multiple format flags with commas:

Extract options

You can also specify this format flag in the field's rule mapping in the Section manager by adding the T format flag in the Mask field:

Field options

Note The Section manager example shows the T format flag used with the XDD rule. The presumption is that when the dictionary element is found, the resulting rule will be the Move_It rule. Adding the T format flag here overrides any mask defined in the XDD definition.

Here are some examples of what happens when you include the T format flag:

This text

Is changed to

11 paces ferry road

11 Paces Ferry Road

SAM DOE

Sam Doe

Marquis de Lafayette

Marquis De Lafayette

George O’Brien

George O’brien

This is the Title Case Option

This Is The Title Case Option

Keep in mind:

See also