Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Java running on a Z/OS mainframe.

Posted on 2007-03-20
3
Medium Priority
?
1,863 Views
Last Modified: 2008-01-09
Hi Experts

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?

Thanks
Dave
0
Comment
Question by:NHBFighter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 57

Accepted Solution

by:
giltjr earned 1000 total points
ID: 18761295
Well, I have not run written any Java applications, but there could be some "misunderstanding" here.

z/OS has a 'split' personality.  It has the traditional "MVS" side and the "OMVS" (Open MVS also called Unix System Services) side.

Each of the sides have their own files systems.  The MVS is is not really like anything you are use to.  However the OMVS side is just like Unix.  If you are running your Java application under the OMVS side it should pretty much run like it would under Unix.  z/OS (the OMVS part) is branded Unix by the Open Unix Group and is POSIX compliant).

Now if you were to try and run this on the "MVS" side, which I am not even sure you can, you would have some issues.

To make it a bit more confusing MVS has a file type called PDS (and PDSE) meaning a partitioned data set (PDSE is just extended).  A PDS is basically a collection of small sequential files, normally related, called members.  These  are stored in a single file with a "directory" that contains information about each member.  It is NOTHING like a directory in the Unix side.

So your Java mainframe guy may be referring to the MVS side of z/OS as the file handles are much different when you access MVS files instead of OMVS files.
0
 
LVL 4

Author Comment

by:NHBFighter
ID: 18761447
giltjr
Thanks for the nice reply I really appreciate it, I see that I have a lot to learn about this sort of thing.
I'll keep the question open for a little bit to see if I can get any more info.

Thanks again
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18772889
>> The code makes explicit references to the file system.  

Put the file path in a properties-file in the same directory as your application, and read it from the properties-file on start-up. This allows you to change the file path on subsequent runs of the program on different systems by just changing the text in the properties-file and not re-compiling the source-code.

http://www.exampledepot.com/egs/java.util/Props.html
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question