Unable to Create File using echo command in 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
kmsekhar
Premium Member
Premium Member
Posts: 58
Joined: Fri Apr 16, 2010 12:58 pm
Location: Chn

Unable to Create File using echo command in Server Routine

Post by kmsekhar »

Hi,

I am creating a sample routine which has to pass a text as argumet and that needs to be stored in to a file. But I am getting <<ERROR>>.

Arg1=some text here
SrcDir=/usr/pathname/
FileName=Output.txt

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H

Text=Arg1
ToCmd = 'echo ' : Arg1 : ' > ' :SrcDir : FileName
Call DSExecute("UNIX",ToCmd,output,retcode)
if retcode = 0 then PRINT "File Created Sucessfully" else PRINT "File Creation Failed"
Ans=0
This is just sample code which I am trying in a routine.. If I got solution for the above then I am changing my original logic accordingly..

Thanks in advance
--
Sekhar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First suggestion, add some 'breadcrumbs' so you know what's going on inside the routine. Use DSLogInfo to push both the 'ToCmd' and the 'output' from the call into the logs as a starting point. Also seems to me there should be more to the error message than what was posted, is that all that was logged?
-craig

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