Java running on a Z/OS mainframe.
Posted on 2007-03-20
I need to have a java program run on a z/OS mainframe and do the following things:
1. Create a new directory and write a new file into that directory.
2. Call an external (external to the JVM) application to act on that file,
3. Delete the created directory and its content.
The code to do this is simple enough, use File.mkdir() method to create a new directory. Create a new FileOutputStream and write to create a new file.
Use the Runtime.exec method to run the application.
Then use File.delete() to remove the files.
I have the code written to do this and have tested it on a Unix and Windows system and all works fine. I haven’t been able to test it yet on the mainframe (political reasons). A java mainframe person here gave me the following warnings about running this code on the mainframe:
1. The code makes explicit references to the file system. File system access is not as straight-forward on MVS as it is on Unix.
2. The code issues an operating system command. Once again, MVS does not honor program invocations in the manner that Unix does.
He didn’t give me any further information about this and hasn’t elaborated any more on it either. Does anyone with knowledge about such things have any information about what is different about the way Z/OS handles file system operations. And why the Runtime.exec() method may not work in this environment?