Issues writing text file to IFS though jt400

672 Views Asked by At

All I'm trying to do is to drop a log on IFS

Here is my code:

  def write(target_filename, data)
    stream = com.ibm.as400.access.IFSFileOutputStream.new(AS400.sys, target_filename)
    stream.write(data.to_java_bytes)
    stream.flush
    stream.close
  end

When i read it though the jt400 library, it comes out ok.

But when i go thought the qShell or wrklnk the file seems empty.

Any ideas why? Is it the CCID?

1

There are 1 best solutions below

0
On BEST ANSWER

Found the issue. I was using IFSFileOutputStream to write binary stream of text. By switching it to IFSTextFileOutputStream, problem was resolved.