java - Rexx的要求
It's more complicated.它更复杂。 Before using the Runtime.getRuntime().exec() method, you must first get the name of your Operating System.在使用Runtime.getRuntime()。exec()方法,您必须先得到您的操作系统的名称。 According you OS, you have to prefix the Rexx script name.根据您的操作系统,你必须前缀Rexx脚本的名称。 For example, in a Linux/Unix shell, if you want to call the "myscript.rexx", you have to type on the command line "./myscript.rexx".例如,在Linux / Unix的外壳,如果你想调用“myscript.rexx”,你必须在命令行“键入。/ myscript.rexx”。 In the java application, you have to do the same thing like :在Java应用程序,你必须做同样的事情一样:
// Getting Operating System name
String OS = System.getProperty("os.name").toLowerCase();
// Name of the Rexx to be executed
String cmd = "hello.rexx";
// Prepearing the command according to the Operating System
if (OS.indexOf("windows 9") > -1) {
cmd = "command.com /c " + cmd;
}
else if ( (OS.indexOf("nt") > -1)
|| (OS.indexOf("windows 2000") > -1 )
|| (OS.indexOf("windows xp") > -1) ) {
cmd = "cmd.exe /c " + cmd;
}
else {
cmd = "./" + cmd;
}
Don't forget the extension ".rexx" to the script name !!! 不要忘记扩展名为“。Rexx的”到脚本的名称!
You may also want to capture the command output by opening an input stream :您可能还希望抓住开放的输入流命令的输出:
String line;
Process p = Runtime.getRuntime().exec(cmdline);
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
// Reading the output messages of the command
while ((line = input.readLine()) != null) {
System.out.println(line);
}
input.close();
If you want a full example (Rexx calling Java and Java calling Rexx), download this file如果你想要一个完整的例子(Rexx的调用Java和Java调用Rexx中),下载这个文件
----------------------
是否可以调用一个REXX(编译或不)从Java程序运行在z / OS的?
We have a new java program and want to leverage an existing rexx script.
我们有一个新的Java程序 , 并希望利用现有的Rexx脚本。 Passing parms and getting data and status back is important. 传递参数和获得数据和状态回是重要的。
Thanks
John
------回复如下
|
|
It is fairly easy to invoke a REXX script if it is run as az/OS Unix REXX script (stored in the HFS/zFS filesystem, without using the TSO command environment). 这是很容易调用REXX脚本 , 如果是宰运行/操作系统Unix的REXX脚本(在居所资助计划不使用存储曹命令环境/ ZFS的文件系统)。
There are several examples of doing this in the IBM JZOS Sample code. 要做到在IBM JZOS示例代码这几个例子。 Look at the following classes in the com.ibm.jzos.sample package: 在下面的类查找在com.ibm.jzos.sample包:
MvsJobOutput MvsJobOutput MvsJobSubmitter MvsJobSubmitter
The JZOS sample source code is available here: 在JZOS示例源代码可以在这里: http://www-03.ibm.com/servers/eserver/zseries/software/java/products/jzos/overview.html
|
分享到:
相关推荐
REXX REFERENCE - Major.pdf REXX 编程参考
rexx 与SDSF 交互 适合IBM主机系统初步了解,rexx基本语法熟悉。 入门级别
rexx安装包,编译的时候需要用到,很难找的
Rexx的简介和程序员参考,Rexx是一种最初为大型机开发的脚本语言,但在从服务器到台式机再到手持设备的各种平台上具有很高的可移植性,并广泛用于快速的应用程序开发。
人人可用的 Rexx-使用自由软件 Rexx 的实现来编写脚本
REXX(Restructured Extended Executor)是IBM在1980年代发明的一种程序设计语言。主要用在IBM的大型计算机(Mainframe Computer)上,在VSE、VM、OS/400、AIX、OS/2其他的IBM平台上也可以找到它的解译器或编译器。...
z/OS TSO/E REXX User’s Guide
z/OSTSO/E REXX Reference
rexx学习入门,适合初学者学习rexx如何使用,如何调用及传递参数等.
想学习大机的朋友,可以下载下来学习学习!!
regina33 ,rexx 编译器
主机REXX语言开发学习资料,很适合于新接触主机的朋友们。
IBM大型主机Rexx技术详细讲解,TSOE REXX USER's Guide.pdf
由于来自 IBM “大型机”环境比重多于 Unix 系统,Rexx 对很多 Linux 程序员和系统管理员是鲜为人知的。但是在 Linux 中仍然有一个重要的领域,在这里,相对于“过轻量级”的 bash 或 ksh shell,或者“过重量级”的...
rexx for z/os quote = 'MY name is' parse var quote word1 word2 word3 say word1 word2 word3 parse upper var quote word1 word2 word3 say word1 word2 word3
TSO/E REXX reference -IBM 英文 PDF 格式
This book introduces how to implement various data structures such as, matrices, stacks, queues,and trees in REXX. In addition, this book illustrates how to implement techniques such as, hashing, ...
rexx vm reference,i think it's a good book for rexx users.
REXX简单入门.doc