info onthe piece of code

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
parvathi
Participant
Posts: 103
Joined: Wed Jul 05, 2006 4:48 am
Contact:

info onthe piece of code

Post by parvathi »

Hi all,

I have to write to an xml file about the job in to a directory.
what does the t.fvar mean . what does it do?
does
write ReportText to t.fvar, v_JobreportFileName else

sufficient to write the full information

please help me on this


Openpath v_logFolder to t.fvar then
write ReportText to t.fvar, v_JobreportFileName else
call DSLogWarn("Failed to write file ":v_JobreportFileName)
end
end
else
call DSLogWarn("Failed to open directory ")
end

close t.fvar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not really, unless you can show us how the v_... variables and the ReportText variable get their values. DSLogWarn requires two arguments. There's no value trying to close a file if you failed to open it.
The variable "t.fvar" is what's called a "file variable" or "file handle" - effectively a pointer to a structure that all other I/O statements must use.

Please enclose your code in Code tags as follows to preserve indenting.

Code: Select all

Openpath v_logFolder to t.fvar Then 
   Write ReportText to t.fvar, v_JobreportFileName Else 
      Call DSLogWarn("Failed to write file ":v_JobreportFileName, "MyRoutine") 
   End 
   Close t.fvar 
End 
Else 
   Call DSLogWarn("Failed to open directory ", "MyRoutine") 
End 
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