I have 2 jobs, xxxparams and qwertyparams. In a transformer, I create a stage variable, var1 = DSJ.ME and get the name of the jobs - ie xxxparams and qwertyparams.
I need a function that will clip off the 'params' part from the end of the jobname dynamically. Any ideas?
Just to make it clear, I need
var2 = funtion(DSJ.ME,clip off 'params' dynamically) that gives xxx and qwerty respectively.
Substring from rear
Moderators: chulett, rschirm, roy
You can use something like this, provided the params always is the suffix and not prefix
I bet others will have a far better solution than me. But try it out.
Code: Select all
funtion(DSJ.ME,Left(jobname,Index(jobname,"params",1)-1))
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Var2 = DSJ.ME[1,LEN(DSJ.ME)-7]
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Umm... isn't DSJ.ME always set to 1 ?
You would need the DSJobName macro or an appropriate function call in there. This is implied by the jobname reference in the first solution.
You would need the DSJobName macro or an appropriate function call in there. This is implied by the jobname reference in the first solution.
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.
I just realized that it was a mnemonic. Use 2 stage variables, first call to get DSGetJobInfo(DSJ.ME,DSJ.JOBNAME) and second one to get the substring from it. Don't use normal derivations, just initial values so it only gets executed one time.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>