Question & Answer
Question
How to create and use a macro in IBM Rational SDL Suite?
Answer
In Rational SDL, a macro is a form of text substitution. In a macro definition, a collection of lexical units is defined. A macro call indicates where the text from the macro definition body is to be included.
In order to use a macro in a SDL System first they have to be created and then called. Attached is a sample for reference.
- Creating a macro
- In the Organizer, Select Edit -> Add New
- Highlight SDL and select Macro from the drop down menu.
- Key in a name in the field New Document Name and hit OK. This will create a .smc file which will store the SDL macro definition.
- Open the .smc file and write a macro definition as shown below:

- Calling a macro:
Macros can be called only using the Macro call symbol in the process diagram.
Note that graphical macro calls are not allowed in a higher scope than process (system, block, etcetera). Also calling a macro using a task symbol is not possible.

To analyze a system containing a macro, turn the Macro expansion button on to order expansion of SDL macros through Generate -> Analyze.
After macros are expanded, the .pr file is used as input and expanded into a .prm file, which includes the SDL macros in an expanded form.
Was this topic helpful?
Document Information
Modified date:
23 June 2018
UID
swg21408449