I have a server routine which is using in a job sequence, I want to capture the return value from the routine and save it in a textfile.
ReconLinkCount(jobname,stagename,linkname)
#include DSINCLUDE JOBCONTROL.H
Ans = 0
ThisJob = jobname
ThisStage = stagename
ThisLink = linkname
JobHandle = DSAttachJob(ThisJob, DSJ.ERRFATAL)
Result = DSGetLinkInfo (JobHandle, ThisStage, ThisLink, DSJ.LINKROWCOUNT)
Nothing = DSDetachJob(JobHandle)
Ans = Result
Return(Ans)
I am passing three values to the routine i.e jobname,stagename and linkname. The routine is returing a value. How to capture and store the return value in a textfile.?
How to capture the return value from a routine
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 21
- Joined: Mon Jul 12, 2010 2:05 am
- Location: India
I believe the commands you need to look at are OPENSEQ to open a sequential file, WRITESEQ to write to a sequential file and CLOSESEQ to close a sequential file.
The InfoSphere DataStage BASIC Reference Guide (and all other release 8.5 manuals) are downloadable from this link for free:
http://www-01.ibm.com/support/docview.w ... wg27008803
The InfoSphere DataStage BASIC Reference Guide (and all other release 8.5 manuals) are downloadable from this link for free:
http://www-01.ibm.com/support/docview.w ... wg27008803
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use an Execute Command activity downstream of the Routine activity.
In the Execute Command activity execute a command that will write the routine output - captured from the $ReturnValue activity variable - into the file. One easy way is an echo command with > or >> redirection as appropriate.
In the Execute Command activity execute a command that will write the routine output - captured from the $ReturnValue activity variable - into the file. One easy way is an echo command with > or >> redirection as appropriate.
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.