Hi Guru's,
some one help me with diffrence between FUNTIONS AND MACROS
Thankyou
ms
macros
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A function is an intrinsic part of the programming language.
A macro is another way to invoke a function, with some or all of the function arguments filled in. DataStage macros are defined in the JOBCONTROL.H file (in the DSINCLUDE directory in the project).
For example, the macro DSJobStatus is replaced, when you compile an expression that uses the macro, with its equivalent function, namely DSGetJobInfo(DSJ.ME,DSJ.JOBSTATUS).
If you examine the generated code, you see the function with which the macro was replaced, rather than the macro itself. It is a task of the job compiler to replace macros with their definitions.
A macro is another way to invoke a function, with some or all of the function arguments filled in. DataStage macros are defined in the JOBCONTROL.H file (in the DSINCLUDE directory in the project).
For example, the macro DSJobStatus is replaced, when you compile an expression that uses the macro, with its equivalent function, namely DSGetJobInfo(DSJ.ME,DSJ.JOBSTATUS).
If you examine the generated code, you see the function with which the macro was replaced, rather than the macro itself. It is a task of the job compiler to replace macros with their definitions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.