AsciIO, CommaIO and TextIO in batch


Apparently, every time I try to initialize an AsciIO, CommaIO or TextIO object in a RunBaseBatch class as a batch process, such as:

fioPermission = new FileIOPermission(filePath,“rw”);
textIO = new Text(filePath + “text.txt”, #io_append, 1252);

The textIO object is always null!

However, if I run the batch interactively, the textIO object is not null.

Any ideas why?

Thank you!

The answer is that the FileIOPermission is needs to match the TextIO constructor’s file access type of #io_append. Hence FileIOPermission should look like new FileIOPermission(filePath, #io_append);.