problem encountered in a routine

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
dsquestion
Participant
Posts: 26
Joined: Thu Feb 03, 2005 1:05 am

problem encountered in a routine

Post by dsquestion »

Hi all,
I have written a routine which fetches the data from text file and passes that value as a parameter to the job.I have called the routine in a routine activity and passed that result to the job as parameter like this routine_stagename$returnvalue. the routine code is

OpenSeq Filepath To FileVar
On Error Call DSLogWarn("Cannot open ":FileVar, "max")
Then ReadSeq FileLine From FileVar
On Error Call DSLogWarn("Error from ":FileVar: " status=":Status(),"max")
Then
Ans = Trim(FileLine)
End

but i am getting the following error

INCR_SEQUENCER..JobControl (@Routine_Activity_0): Controller problem: Unhandled failure (0001k27e) encountered calling routine DSU.max

Note:0001k27e is the data fetched form the text file


comments appreciated
Thanks in advance
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

You might not want to use FileVar, but rather use FilePath (in your DSLogWarn) since FileVar is a handle to the file you just opened.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Put a call DSLogInfo('Entering MAX Routine','') in your routine; I think your error is not being generated from where you think it is.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Did you call the routine as 'max'?

You may need to set a default value for Ans in the beginning in order to return some value back.
dsquestion
Participant
Posts: 26
Joined: Thu Feb 03, 2005 1:05 am

Post by dsquestion »

Hi all,
Thanks for ur replies.I have tried all your solutions It is still giving the same problem.Can you please change the code how it should be.My routine name is max ,sainath.

Thanks
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Try the following
1.) include a dsloginfo message as the first and last lines of the routine.
2.) run the routine in a stand-alone mode.
3.) Check your sequencer (probably INCR_SEQUENCER) to confirm whether all relevant parameters are passed correctly. Save and recompile.
Post Reply