Macro
Moderators: chulett, rschirm, roy
If you write a routine called "MyRoutine" then do you want some sort of a DS function call which will return "DSU.MyRoutine"? If that is what you are asking then I think it might be possible, but I'm not sure it can be done. It might depend upon how the routine was called.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Here is exactly what i want to do
I want to replace "ZoneNull" witch it's the actual name of my routine by a macro.
So i don't have to tkink to change the name when i'll reuse the code.
Thanks
Code: Select all
if len(trim(Zone))=0 or isnull(Zone) then
Begin Case
case Type='A'
Ans=" "
case Type='N'
Ans="0"
case @TRUE
Call DSTransformError("Valeur de parametre iconnue ":Type,"ZoneNull")
Ans=@NULL
end case
end Else
Ans=Zone
end
So i don't have to tkink to change the name when i'll reuse the code.
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It's not possible.
What I do as standard practice is to place an EQUATE declaration at the beginning of every routine.
This behaves like the macro you seek. Because it's at the top of the code, it's obviously there needing to be changed when the code is copied.
What I do as standard practice is to place an EQUATE declaration at the beginning of every routine.
Code: Select all
Equate RoutineName To "MyRoutine"
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.
Just as Ray stated, I always have my first code line in every program , and usually the second line is .
I thought the stack might contain an easily accessible name of the current routine, but I've done some checking and this value isn't available.
Code: Select all
EQUATE ProgramName TO "name-of-routine"
Code: Select all
EQUATE Version TO "x.x.x"
I thought the stack might contain an easily accessible name of the current routine, but I've done some checking and this value isn't available.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
so my code will be
am i right ?
Code: Select all
Equate RoutineName to "ZoneNull"
Equate Version to "1.0"
if len(trim(Zone))=0 or isnull(Zone) then
Begin Case
case Type='A'
Ans=" "
case Type='N'
Ans="0"
case @TRUE
Call DSTransformError("Valeur de parametre iconnue ":Type,RoutineName:Version)
Ans=@NULL
end case
end Else
Ans=Zone
end
In JobControl you can use DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>