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
Problem while ruuning the routine
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.