Define Macros

Overview

The macros.cfg configuration file defines macro values for substitution into batch jobs, and overrides predefined values. This file is located in install-path/etc. Each line in the file represents a macro value in the form key = value, where the key is the macro name and the value is its value. The following example of a macro defines a Windows path:
INPUT_FILE_PATH = C:\files\inputfile.txt
On a UNIX system:
INPUT_FILE_PATH = /home/dfuser/files/inputfile.txt
The example macro is useful when you are porting jobs from one machine to another, because the paths to an input file in different operating environments often differ. By using a macro to define the input filename, you do not need to change the path to the file after you port the job to UNIX. You add the macro to install-path/etc/macros.cfg in both the Windows and UNIX, and set the path appropriately in each.
The etc directory contains the macros.cfg file and a macros subdirectory. The macros subdirectory can contain multiple .cfg files. If one or more of the .cfg files exist in that subdirectory, then they will be read in alphabetical order before the macros.cfg file is read. The last value read becomes the value that is applied.
If your jobs use system and user-created macros, you must create a combined macro file to be able to use the macros in DataFlux Data Management Server. For more information about macros, see the online Help for DataFlux Data Management Studio.

Declare Input and Output Variables for Data Services

Prior to Release 2.2, the macros that were passed into real-time data services were the only ones that could be returned. Also, any macro variable was allowed to be passed to the service, even if it was not being used by the service.
In Release 2.2 and thereafter, input and output variables for real-time data services behave similarly to variables of real-time process services and batch jobs. Specifically, only input variables that are declared in a real-time data service job can be passed in, and only final values for declared output variables will be returned. If a variable that was not declared as input is passed into a data service, then an error is returned. To revert to behavior prior to Release 2.2, set the following configuration option in the service.cfg file:
DATASVC/IGNORE_DECLARED_VARS = yes

Update Macros

About Updates

For each job process, the DataFlux Data Management Server reads configured macros at the beginning of execution. When a macro changes, you can update the macro on the server without having to restart the server, using one of the following procedures.

Update Macros for Process Services, Batch Jobs, and Profile Jobs

For real-time process services, batch jobs, and profile jobs, all of which are executed by separate instances of the DFWFPROC process:
  1. In the Data Management Servers tree in Studio, select a server by name.
  2. Right-click on the server name and select Unload idle processes from the drop-down menu.
Unloading idle processes also updates macros for all subsequent instances of the DFWFPROC process.

Update Macros for Real-Time Data Services

For real-time data services, all of which are executed by separate instances of the DFWSVC process:
  1. In the Data Management Servers tree in Studio, expand a server by name.
  2. Select the Real-Time Data Services folder under.
  3. In the right pane click the Loaded Processes tab.
  4. Select all of the processes under Process ID, and then click one of two buttons depending on the status of the job: Unload Process When Idle, or Unload Process: