Variables contain information that will remain
constant for one scan of the import specification. Variables can be
taken from within the file or outside the file. For example, the variable
&PERIOD could be entered by the user at a prompt, taken from the
file name, a specific row and column of the file and so on. Variables
once defined, can be used in the definition of fields, operation templates
and other variables. Variables can also be created to scan the file
a specified number of times. Please note that only one such variable
can be defined per import specification.
You can use
this tab to create a variable and define such features as the following:
- A variable name, which always begins with & and must be followed
by the following character types only: -, 0-9, A-Z.
- Whether the file contains values for several periods or actualities,
and in that case how many times the file should be loaded.
- The variable's format and the source of the variable's initial
value, e.g. whether the value is retrieved from the file name, whether
it is a static value or whether it refers to another variable.
- Which operation or operation template must be performed before
the value can be created.
Before you begin
If you use a variable to prompt the user for certain information
when the import specification is being run, you can name the variable
in two ways: Either as &COMP, for example, which opens a dialog
box with a question and a pop-up in which the user enters the relevant
information. You can also name the variable &COMPANY (the same
name as the COMPANY field), which opens a pop-up in which the user
can choose from all available company codes.
Note: All variable names must begin with an ampersand (&) and must
be followed by the following character types only: -, 0-9, A-Z.
Procedure
- On the Transfer menu, click External Data/Define Import Specifications. The Define Import Specification window opens.
- In the Specification list box, select
the specification you want to change, or click the New button and enter a new name and press Enter.
- On the Variables tab, click the New Variable button to add a new variable. In the dialog
box that opens, enter the name of the new variable and click OK. The new variable starting with "&" is displayed
in the Defined Variables list box.
- In the Description text box, enter
a description of the variable.
- Select Repeat Factor to specify
how many times the file is to be read if it contains values for several
periods or actualities.
- From the Format option group, select
the variable format.
- Specify the variable field length and also the number of
decimals if the variable is numeric.
- From the Origin option group, select
an option from where the variable information should be retrieved.
- File - refers to a row in the file. Specify
the relevant row number. This will be valid even if the specified
row is skipped according to the filter definition.
- Prompt - prompts the user for information
before importing the file. Enter the message to be displayed when
the prompt appears. The message appears only once, even if the repeat
factor is used.
- File Name - uses the file name as variable
information.
- File Extension - uses the file extension
as variable information.
- Static - uses a static value, for example,
to run a loop several times. Enter the static value in the text box.
- Variable - refers to another defined variable.
Select the relevant variable.
- From the Operation option group,
select the operation to use for refining the information:
- None - nothing needs to be carried out.
- Item - refers to a specific field in the
file. Enter the item number and the separator.
- Substring - refers to a specific position
in the file, a variable or a temporary field. Enter the from position
and the number of positions to be used.
- Operation Template - refers to an operation
template. Select the relevant operation template.
- Click Save and open the Fields (1) tab.