User Guide > Managing Macro Sets and Macros
Was this helpful?
Managing Macro Sets and Macros
This topic provides information about 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, usually file paths and credentials to databases or CRMs. Assigning a meaningful macro name like TARGET 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. 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.
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.
Project-level macro sets with macros: From the workspace-level macro set, you can specify the macro sets for a project using the Preferences window. This is for design-time only and this list is stored in the .prjmetadata file in the project workspace location. If required, this file can be copied to other projects.
Local macros: You can define macros for a specific map or process. By default, it 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 for the map (or process). The local macros should not be used during design-time and must be used only during runtime.
Execution service macros: These macros are available during job execution to provide information about the current job.
If you add a macro set to a project and create a new map, the macro set is available on the Configuration tab > Macros section in the map file.
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 > Preferences > DataConnect > Macros or 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), 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
Note:  With compatibility mode off, you can encrypt macros for sensitive values such as passwords to prevent them from being viewed in plain text.
Last modified date: 08/02/2023