Assigning a Logical Name With the Allocation Wizard

In this section:

How to:

Reference:

For a file managed by the operating system, such as an ISAM or comma-delimited data file, the physical file name is the actual name of a file as it appears to the operating system. A logical name (or ddname) is a shorthand name that points to the physical file name. Logical names simplify code by allowing short names to be used in place of the longer physical file name.

The FILEDEF command assigns a logical name to a physical file name and specifies file attributes. You can explicitly define a file and its location to WebFOCUS using the Allocation Wizard. The Allocation Wizard generates platform independent file paths for all portable platforms by creating FILEDEF syntax with application names. An Allocation can be issued in a procedure and lasts for a single request.

It is recommended that instead of including an Allocation in each procedure, you include all FILEDEF commands in a single file that you call with the -INCLUDE command at the beginning of each procedure. This enables you to make changes to your FILEDEF commands globally instead of changing the Allocation information in each procedure.

The FILEDEF command is typically used in the following ways in operating systems that support this command:

You can also use the Universal Naming Convention (UNC) to assign logical names to files that are located on a server. In order to take advantage of the UNC you must first attach to the server you want to use. For information on attaching to a server or mapping network drives, consult your Network Administrator.


Top of page

x
Procedure: How to Define a Logical Name With the Allocation Wizard
  1. Right-click the procedure in the Procedures folder and choose Edit in Developer Studio Tool from the shortcut menu.

    The Procedure (FOCEXEC) window opens.

  2. Click a component connector (yellow diamond), and select Allocation Allocation from the Component Connector toolbar.

    The Allocation Wizard opens, as shown in the following image.

    Allocation Wizard diagram

  3. Click Next and specify the logical name for the allocation.

    The following image shows that a name can be from one to eight characters. If you are identifying a data source, the name must be the same as the name of the Master File.

    Allocation Wizard diagram

  4. Click Next and select the device for the logical name.
    • Disk associates the logical name with a file. This is the default option.
    • Printer associates the logical name with a printer.
    • Http associates the logical name with a URL, by allocating the Master File to the result of running the URL.
    • Terminal indicates that the keyboard and monitor are the input source and output destination for the file.
    • Clear clears the allocation assigned to a file name. The device options are shown in the following image.

    Allocation Wizard diagram

  5. Click Next to select additional options.

    Note: The options vary depending on which device is selected. The steps below detail how the Allocation Wizard continues with the selected device.

    Tip: At any time, you may click Back to go back and change the device, or any of the device settings.

  6. When selecting Disk as the device:
    1. Select the application folder that contains the physical file.

      Note: The application folders from the Reporting Server are shown by default and depend on the area from which the Allocation Wizard is invoked. For example, Local Projects, Data Servers, or Managed Reporting. You may specify a file in a directory that is not in the Reporting Server Application Path by using the Advanced option from the completed Allocation. For more information, see Advanced Allocation Dialog Box. The Application folders are shown in the following image.

      Allocation Wizard diagram

    2. Click Next and enter the new file name, as shown in the following image.

      Allocation Wizard diagram

      or

      Click the Browse button to display the Open dialog box and select from the list of existing files, as shown in the following image.

      Allocation Wizard diagram

      Note: Data files (*.dat) is the default value for the files of type drop-down list. You may also select Temporary Files (*.ftm), and All Files (*.*), as the type of file.

    3. Click Next to specify additional options for the Disk device, as shown in the following image.
      • Appends records to the end of the file (without this option, the file is overwritten).
      • Fixed length records indicates that you are assigning a logical name to a file with a fixed record length.
      • Record Size specifies the record length of the file, when using the Fixed length records option.

      Allocation Wizard diagram

    4. Click Next to view the summary of the allocation settings you selected for the Disk device, as shown in the following image.

      Allocation Wizard diagram

  7. When selecting Printer as the device:
    1. Select the application folder that contains the physical file.

      Note: The application folders from the Reporting Server are shown by default and depend on the area from which the Allocation Wizard is invoked. For example, Local Projects, Data Servers, or Managed Reporting. You may specify a file in a directory that is not in the Reporting Server Application Path by using the Advanced option from the completed Allocation. For more information, see Advanced Allocation Dialog Box, The application folders are shown in the following image.

      Allocation Wizard dialog box

    2. Click Next and enter the new file name, as shown in the following image.

      Allocation Wizard dialog box

      or

      Click the Browse button to display the Open dialog box and select from the list of existing files, as shown in the following image.

      Allocation Wizard dialog box

      Note: Data Files (*.dat) is the default value for the Files of type drop-down list. You may also select Temporary Files (*.ftm), and All Files (*.*), as the type of file.

    3. Click Next to enter the name of the printer, as shown in the following image.

      Allocation Wizard Diagram

    4. Click Next to view the summary of the allocation settings you selected for the Printer device, as shown in the following image.

      Allocation Wizard diagram

      Note: The following syntax is applied to the FILEDEF statement when using a Printer device:

      FILEDEF OFFLINE PRINTER BASEAPP/TEMPOFFLINE.FTM (PRINTER \\ibiprint\28C1
  8. When selecting Http as the device:
    1. Enter the full URL path, as shown in the following image.

      Allocation Wizard diagram

    2. Click Next to view the summary of the allocation settings you selected for the Http device, as shown in the following image.

      Allocation Wizard diagram

  9. When selecting Terminal as the device:
    1. Click Next to specify additional options for the Terminal device.
      • You may choose to send the keyboard input to WebFOCUS as entered (lowercase or mixed-case). The default is mixed-case. Select this option to specify lowercase, as shown in the following image.

        Allocation Wizard diagram

    2. Click Next to view the summary of the allocation settings you selected for the Terminal device, as shown in the following image. Allocation Wizard Dialog box
  10. When selecting Clear as the device:
    1. Click Next to view the summary of the allocation settings that you cleared, as shown in the following image.

      Allocation Wizard dialog box

  11. Click Finish to close the Allocation Wizard and create the FILEDEF command.

    The completed file name appears for the Allocation, as shown in the image below.

    Allocation Wizard dialog box

  12. Optionally, click Check to validate the FILEDEF command.

    A dialog box opens, displaying the component code and confirmation that no error exists.

  13. To edit the selected allocation, double-click, or click Edit, to open the Allocation Wizard again.
  14. Click Advanced to open the Advanced Allocation dialog box.

    The Advanced Allocation dialog box enables you to enter the FILEDEF command without using the Allocation Wizard. For details, see Advanced Allocation Dialog Box.

  15. Click OK to close the completed Allocation Wizard.

    The Allocation component is added to the procedure. You may double-click the component to view the completed Allocation Wizard options again.


Top of page

x
Reference: Advanced Allocation Dialog Box

When you click Finish from the Allocation Wizard, the Allocation Wizard dialog box displays the completed logical allocation name that you created. Click Advanced to open the Advanced Allocation dialog box to enter the FILEDEF command without using the Allocation Wizard.

Note: When you create a FILEDEF command with the Advanced option, the Allocation is added to the procedure as a component. You may double-click the component to view or edit the command in the Advanced Allocation dialog box, as shown in the following image.

Allocation Wizard dialog box

Name

Shows the logical (defined) name of a file or device (one to eight characters).

Device

Identifies the type of device to associate with the logical name.

Disk associates the specified logical name with a file.

Printer associates the specified logical name with a printer.

Http associates the Hypertext Transfer Protocol link, by allocating the Master File to the result of running the URL.

Terminal indicates that the keyboard and monitor are the input source and output destination for the file.

Clear clears the FILEDEF command assigned to a file name. (Select the logical name in the list below the Name box.)

File name

Shows the full file name. It may include a drive and directory specification.

Enter a file name in the box, or click the Browse button to open a dialog box and select the file.

Note: You may use the File name field to specify a directory that is not in the Reporting Server Application Path.

Fixed

Indicates that you are assigning a logical name to a file with a fixed-record length.

Enter the length of the record in the Record Size box.

Record Size

Specifies the record length of the file.

Append

Appends records to the end of the file. Without this option, the file is overwritten.

Lower Case

Retains the case (lowercase or mixed-case) of keyboard input in the Command Console.

OK

Closes the Advanced Allocation dialog box and adds the FILEDEF command to the completed Allocation Wizard dialog box.

Cancel

Closes the Advanced Allocation dialog box without saving the allocation settings.

Help

Opens the online documentation for this topic.

Check

Displays the FILEDEF command in code, and specifies any errors.

New

Moves the cursor into the Name box for a new FILEDEF command entry.

Delete

Deletes the logical name you select from the list below the Name box.


Top of page

x
Clearing Allocations

How to:

You can clear Allocations by using the Allocation Wizard and with the Advanced Allocation dialog box.



x
Procedure: How to Clear an Allocation With the Allocation Wizard
  1. Double-click the Allocation component to view the completed Allocation.
  2. Select the Allocation name and double-click, or click Edit, to open the Allocation Wizard.

    Note: The Allocation opens with the tool you used to create the FILEDEF command, in this case, the Allocation Wizard.

  3. Click Next twice, for the device options section of the Allocation Wizard, and select Clear.
  4. Click Next and Finish to close the Allocation Wizard.
  5. Click OK from the completed Allocation Wizard dialog box.


x
Procedure: How to Clear an Allocation With the Advanced Allocation Dialog Box
  1. Double-click the Allocation Component to view the completed Allocation.
  2. Select the Allocation name and double-click, or click Edit, to open the Advanced Allocation dialog box.

    Note: The Allocation opens with the tool you used to create the FILEDEF command, in this case, the Advanced Allocation dialog box.

  3. Select the Clear radio button under the Device section.
  4. Click OK to close the Advanced Allocation dialog box.
  5. Click OK from the completed Allocation Wizard dialog box.

WebFOCUS