我对AS400和RPG有非常有限的(0)知识.但是我们迫切需要从java类调用RPG程序.所以我发现我们可以通过JTOpen实现它.但我坚持宣布ProgramParameter列表.我有关于RPG计划的以下信息
程序名称:ZM30000R
参数:
分支7,0(数字)
帐户类型2(01检查,02节省)
账号20(字符)
错误代码7(字符)
DR / CR指示符1(字符D,C)
但是没有关于什么是输入和输出的线索.如何声明ProgramParameter.我做了如下.我也无法测试,因为我没有这些系统的连接.
// Create AS400 Text objects for the different lengths
// of parameters you are sending in.
AS400Text branchTxt = new AS400Text(7);
AS400Text accntTypeTxt = new AS400Text(2);
AS400Text accntNumberTxt = new AS400Text(20);
AS400Text errorCodeTxt = new AS400Text(7);
AS400Text DCIndicatorTxt = new AS400Text(1);
// declare and instantiate your parameter list.
ProgramParameter[] parmList = new ProgramParameter[5];
// assign values to your parameters using the AS400Text class to convert to bytes
// the second parameter is an integer which sets the length of your parameter output
parmList[0] = new ProgramParameter( branchTxt.toBytes(branch),7);
parmList[1] = new ProgramParameter( accntTypeTxt.toBytes(accntTypeTxt),2);
parmList[2] = new ProgramParameter( accntNumberTxt.toBytes(accntNumberTxt),20);
parmList[3] = new ProgramParameter( errorCodeTxt.toBytes(""),7);
parmList[4] = new ProgramParameter( DCIndicatorTxt.toBytes(indicator),5);
任何帮助都非常有用.
感谢致敬,
SRINIVAS