While running following routine
$INCLUDE DSINCLUDE JOBCONTROL.H
InfoMessage = Arg1
PathName = Arg2
Output =''
OpenSeq PathName To FileVar Else ; * Open the sequential file or if not exist then create seq file
CREATE FileVar ELSE ABORT
WriteSeq InfoMessage TO FileVar ELSE STOP ; * writing input argument(Arg1) to FileVar
End
Ans = ''
Loop
ReadSeq FileLine From FileVar ; * Read sequential file through Fileline
On Error
Call DSLogWarn("Error from ":PathName:" status=":Status(),"MyRoutine")
End
Then
Cmd = 'grep ':'_':' ':FileLine ; * Text for searching the "_" character in InfoMessage
Call DSExecute('UNIX',Cmd,Output,SystemReturnCode) ; * Call DSExecute command to run in Unix
Ans = Output ; * Assign the Output of grep command in Ans variable
End Else
Exit
End
repeat
CloseSeq FileVar
===================
Test Output
TEST #1
*******
Arg1 = sequential_file_12345
Arg2 = /abc.txt
Test completed.
Result = grep: can't open sequential_file_12345
===============
Here i provide Arg1 = sequential_file_12345, so my result should be same as Arg1 however in this case i am gettng Output :
Result = grep: can't open sequential_file_12345
Pls look into this and advice me for same
Regards,
Hiten
No proper output while running routine
Moderators: chulett, rschirm, roy
No proper output while running routine
Last edited by hhh on Thu Sep 21, 2006 1:18 am, edited 4 times in total.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Your code is confused. For example, consider what this code fragment does if the pathname exists. What did you want it to do?
Do you REALLY want to work with files in the root directory (/abc.txt)? Do you have sufficient permission to do so?
Code: Select all
OpenSeq PathName To FileVar Else
CREATE FileVar ELSE ABORT
WriteSeq InfoMessage TO FileVar ELSE STOP
End
CloseSeq FileVar
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: