Define Import Structure Specifications - the Variables Tab

You can use this tab to create and define features for variables.

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.

If you use a variable to prompt the user for certain information when the import specification is 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.

Before you begin

For a prompt to call a pop-up list, the IBM® Cognos Controller structure you use must already exist in the database.

Procedure

  1. On the Transfer menu, click External Structures/Define Import Structure Specification. The Define Import Specification window opens.
  2. 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.
  3. 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.

    A variable name always begins with & and must be followed by the following character types only: -, 0-9, A-Z.

  4. In the Description text box, enter a description of the variable.
  5. Select Repeat Factor to specify how many times the file is to be read if it contains values for several periods or actualities.
  6. From the Format option group, select the variable format.
  7. Specify the variable field length and also the number of decimals if the variable is numeric. A blank field for Decimals means that no decimal places should be used.
  8. From the Origin option group, select an option from where the variable information should be retrieved:

    The source of the initial value of the variable, that is where the value is retrieved from, is entered here.

    • 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.
  9. From the Operation option group, select the operation to use for refining the information:

    The operation, which must be carried out before the value can be created, is entered here.

    • 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.
  10. Click Save and open the Fields (1) tab.