User Guide > Managing Macro Sets and Macros
Was this helpful?
Managing Macro Sets and Macros
This topic provides information about creating and managing Macro Sets and Macros.
Macros are used to save certain values that you can use at design and run-time. Macros use symbolic names for text strings or numbers, usually file locations and credentials to databases or CRMs. Assigning a meaningful macro name like TARGET_PATH to a file path, and using it when creating connections, saves time and reduces errors. The primary purpose of macros is to enable you to redefine the text string that a macro name refers to without the need to change the original transformation or process. This also makes it easier to share your transformations and process where one person's TARGET_PATH can be defined differently from someone else's. Or your development path can be different from your production path but they both execute the same transformation.
You can redefine macros from the engine command line or create EZscript expressions that are triggered by events to redefine a macro dynamically during a transformation or process. Macros can be grouped together in a macro set.
The following types of macro sets and macros are available:
Workspace-level macro sets with macros: All the macro sets and macros are stored in a single macro definition file (specified in Options > Preferences > DataConnect > Macros) and they belong to the current workspace. You can add macro sets and macros to macro sets for a workspace only in the Preferences window. Workspace-level macros are ALL the macros available to any transformation or process within the workspace. The same workspace-level macro definition file can be used across different workspaces or you can have a separate one for each workspace.
Project-level macro sets with macros: From the workspace-level macro set, you can specify the macro sets for a project by right-clicking the project and selecting Macro Set References. These are for design-time only and the list is stored in the .prjmetadata file in the project workspace location. If required, this file can be copied to another projects. Project level macros are a design time convenience. For any new transformation or process, all project level macro sets will be copied to the new artifact configuration so that you don't have to add them yourself.
Local macro sets with macros: Local macros can be added from the Configuration tab > Macros section and are for a specific single map, process, or data profile. By default, the macro set includes the project-level macro sets and macros. You can add additional macros from the workspace-level macro list or remove any of the project-level macro. This list is stored in the map or process runtime file. The macros from this list are the ONLY macros that can be pasted into the map (or process). The local macros will not be used during design-time and must be used only during runtime. They allow you to override existing values for a specific run of the transformation or process.
Execution service macros: These macros are available during job execution to provide information about the current job. For more information, see Execution Service Macros.
The GLOBAL and LOCAL macros are always displayed. You can only add macros to the local macro set in a map or process. To add macros to workspace or project, go to Options > Manage Macros. You can override a macro value, in the Macros section on the Configuration tab.
You can do the following:
Set the macro definition file to be used as part of the DataConnect perspective preferences
Create, delete (except global and local), edit, and duplicate macro sets
Create, delete, edit, and duplicate macros within a macro set
Copy or move macros to different macro sets
Encrypt macros
Use macros in various location in UI
Include the macro definition file in a packaged djar
Last modified date: 02/09/2024