Problem while ruuning the 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
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Problem while ruuning the routine

Post by hhh »

While running routine with two input arguments,
i am getting runtime message
TEST #1
*******

Arg1 = sequential_file_123
Arg2 = /auto/abc.txt

Test completed.


Result = Program "TSTMatchFieldTest.B": Line 4, Variable "ANS" previously undefined. Empty string used.

**********
$INCLUDE DSINCLUDE JOBCONTROL.H
InfoMessage = Arg1
PathName = Arg2
Output =''
OpenSeq PathName To FileVar Else
CREATE FileVar ELSE ABORT
WriteSeq InfoMessage TO FileVar ELSE STOP
Cmd = 'grep ':'file':' ':FileVar
Call DSExecute('UNIX',Cmd,Output,SystemReturnCode)

CloseSeq FileVar
Ans = Output
End
**********

please suggest your ideas on same.

Thanks & Regards,
Hiten
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is a path through your logic where the Ans variable is not assigned a value. In your code, Ans is only assigned a value if the Else clause of the OpenSeq statement is executed. Make sure you always assign a value to Ans.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply