Problem to write a file

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
ArijitS
Participant
Posts: 24
Joined: Sat Jun 02, 2007 8:58 am
Location: Kolkata

Problem to write a file

Post by ArijitS »

i want to write some log message using the following routine.but it is not creating any file "I:\TELSTRA_DATASOURCE_ETL\FLEXCAB\TMP\LogFile.txt"
Can any one help me to finding the problem:

ErrorCode = 0 ;* set this to non-zero to stop the stage/job

$INCLUDE DSINCLUDE JOBCONTROL.H

cmd1="move /Y I:\TELSTRA_DATASOURCE_ETL\FLEXCAB\SRC\*.csv I:\TELSTRA_DATASOURCE_ETL\FLEXCAB\PRCSD"

Call DSExecute("NT", cmd1, op, SystemReturnCode)

* FILEPATH=I:\TELSTRA_DATASOURCE_ETL\FLEXCAB\TMP\LogFile.txt

path=DSGetParamInfo(DSJ.ME, "FILEPATH", DSJ.PARAMDEFAULT)

if SystemReturnCode<>0 then

OpenSeq path to objVar then

WeofSeq objVar

end

message1="Before-Job Routine Aborted":" ":"Error-Code1=":SystemReturnCode
WriteSeqF message1 to objVar then
end

CloseSeq objVar
end
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

1.Put in a

Code: Select all

CALL DSLogInfo('Path is "':path:'".','')
to see what value you are getting for the path.
2. Add an error and else code branch to your OPENSEQ command.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why, from that, would you expect any file called Logfile.txt to be created, there or anywhere? I can not see anywhere, in your code, that a file of this name is opened/created and/or written to. You've commented out the statement that assigns the file path. You do not verify that the call to DSGetParamInfo() was successful.
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