‎2007 May 23 11:55 AM
hi to all,
wat is the differences b/w macro and subroutines.pls provide me ans if usefull full points to all.
thanx
lokanadhan.k
‎2007 May 23 12:02 PM
Hi,
Macros can only be used in the program in which they are defined in and only after the definition.
Macros can take max 9 parameters.
Macros are expanded at compilation / generation.
Macros debugging is not possible
Subroutines (FORM) can be called from both the program in which they are defined in and other programs ('perform ' and 'perform in program ').
Subroutines can take any amount of parameters.
Subroutines are 'expanded' at runtime.
Subroutienes debugging is possible
rgds,
bharat.
‎2007 May 23 11:56 AM
‎2007 May 23 11:57 AM
one difference is
In subroutines we can pass USING , TABLES and CHANGING parameters
but in macros we cannot use that
‎2007 May 23 12:02 PM
Hi,
Macros can only be used in the program in which they are defined in and only after the definition.
Macros can take max 9 parameters.
Macros are expanded at compilation / generation.
Macros debugging is not possible
Subroutines (FORM) can be called from both the program in which they are defined in and other programs ('perform ' and 'perform in program ').
Subroutines can take any amount of parameters.
Subroutines are 'expanded' at runtime.
Subroutienes debugging is possible
rgds,
bharat.
‎2007 May 23 12:32 PM
All the above answers are usefull....... I will go functionality wise.
A macro consists of number of executable statements. Whenever a program gets executed at the place of macro name in the program, the set of exucateble statements get executed and the memory allocated to the macro is released...
In case of subroutines, the control places a call to form routine and wait for its processing... As per the performance it is branching control from perform stmt to form-end perform stmt.....
Hope u have got some idea..
regards......