passing file path as a parameter to server routine

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Sgiri1
Participant
Posts: 43
Joined: Sat Nov 08, 2008 10:58 pm
Location: Tambaram

passing file path as a parameter to server routine

Post by Sgiri1 »

Hi,

I need to parameterize the file path and pass it as an input to the routine. I tried using the rotuine stage. But it doesnt works.

check=''
Ans='error'
OpenSeq path_seq To tempvar Then
End
ReadSeq ChkLine From tempvar
Then
check = ChkLine
end
close tempvar

Ans=check

where path_seq is the path of my file....how do i pass it when the routine is invoked in a sequencer job?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

As a Routine argument.

Or within your function using DSGetParamInfo(), but that will only work while the routine is being run from a job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And their names will default to Arg1, Arg2 etc but you can change that and name them appropriately if you so desire.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sgiri1
Participant
Posts: 43
Joined: Sat Nov 08, 2008 10:58 pm
Location: Tambaram

Post by Sgiri1 »

chulett wrote:And their names will default to Arg1, Arg2 etc but you can change that and name them appropriately if you so desire. ...
When i test the routine passing the path as a value for the argument the routine works fine. but in my sequence i assign this path to a aparameter in job properties and call this parameter in the routine activity stage in the sequence job. i need to pass this value as a parameter to next job. when run the sequencer the output of the routine activity stage is jus ''
please help me figuring out what went wrong
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Put a DSLogInfo() call into your routine to report what pathname it received. Put DSLogInfo() calls into all four clauses of the OpenSeq statement to report which is taken. Put a DSLogInfo() call into the Then and Else clauses of the ReadSeq statement to report what happened and what was read.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Post the syntax you are using to call it and confirm you have the Job Parameter defined properly in the Sequence job that uses the Routine Activity.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply