Hi,
i am java-programmer and a rookie by mainframe, so I have some questions:
i want to read a lot of files in mainframe and convert them to a other file.
I can use the class FileFactory to open ONE file and to write to ONE other file.
So, how can I read from a path? Is there a definition of "path" in mainframe? Normally in Java I can use the Class java.io.File to handle it, but can I use it
in mainframe envirement?
thanks for help
Stefan
Use JZOS(FileFactory) to get files from "path"
On z/OS, there are different "file system" types:
1) A "Posix" (Unix) file system, aka "HFS" or zFS".
This is a file system as you would find on a Unix/Linux system.
These files can be used in z/OS Java using the standard java.io package
2) MVS Datasets
These files are natively record-oriented, not stream oriented.
JZOS provides a ZFile class for opening these in record, text-stream, or binary-stream mode.
The JZOS FileFactory class can be used to open streams on either of the above types, by using the filename to determine which to use. Please refer to the JZOS javadoc for more information.
1) A "Posix" (Unix) file system, aka "HFS" or zFS".
This is a file system as you would find on a Unix/Linux system.
These files can be used in z/OS Java using the standard java.io package
2) MVS Datasets
These files are natively record-oriented, not stream oriented.
JZOS provides a ZFile class for opening these in record, text-stream, or binary-stream mode.
The JZOS FileFactory class can be used to open streams on either of the above types, by using the filename to determine which to use. Please refer to the JZOS javadoc for more information.
thx a lot......
we use MVS and I should use ZFile to read files.
my problem is, I dont know how to open a path and get its files, if we have
more than one and dynamically files.
For example:
normally I use java.io.File to open a path like /tmp:
java.io.File filePath = new java.io.File("/tmp");
if ( filePath.isDirectory() ) {
String[] filesUnderTmp = filePath.list();
// open the files
for ( int i=0; i < filesUnderTmp.length; i++ ) {
// open one with FileFactory or ZFile
}
}
I can not find any functions to get a list of files in "path".
Thanks
regards
Stefan
we use MVS and I should use ZFile to read files.
my problem is, I dont know how to open a path and get its files, if we have
more than one and dynamically files.
For example:
normally I use java.io.File to open a path like /tmp:
java.io.File filePath = new java.io.File("/tmp");
if ( filePath.isDirectory() ) {
String[] filesUnderTmp = filePath.list();
// open the files
for ( int i=0; i < filesUnderTmp.length; i++ ) {
// open one with FileFactory or ZFile
}
}
I can not find any functions to get a list of files in "path".
Thanks
regards
Stefan