在ILE COBOL计划中获得返回的价值
我正在尝试从COBOL程序中的C程序中获取返回的值。但是,他们提到了这一点:
“对于带有链接类型的程序的程序,不允许给予/返回短语。”
那么什么是替代方案?如何在COBOL程序中获得返回的值?找不到。 谢谢。 - 编辑 我发现这个 https://www.ibm.com/docs/en/rdfi/9.6.0?topic = sssae4w_9.6.6.6.0/com.ib.m.thools.iseries.iseries.ielecbl.ilecbl.ilecbl.doc/lnc2762.htm 他们表明“更改所谓程序的链接”,但我不知道该怎么做。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短答案
IBM上的ILE程序我不支持返回值。
您需要使用输出参数。
长答案
在 offset 108
。
文档说:
IBM的芭芭拉·莫里斯(Barbara Morris),RPG编译器开发团队的一部分,在线线程中提到的
扩展的答案
如您的编辑中所述,“更改链接”是否会怀疑将C代码从 *pgm对象移动到 *srvpgm对象(用于绑定逐个参考使用)或 *模块对象(by-by-copy)。
ILE过程(又称功能)可以返回值。
对于ILE C/C ++致电C/C ++ PGM
ile c/c ++程序员指南 ..
但是我认为这不会有助于COBOL调用C/C ++。
Short answer
ILE Programs on the IBM i don't support return values.
You'd need to use a output parameter.
Long Answer
In the JOBI0600 format of the Retrieve Job Information (QUSRJOBI) API there's a 4byte integer field "User Return Code" at offset 108.
However
The documentation says:
IBM's Barbara Morris, part of the RPG compiler development team, mentioned in an online thread
Expanded Answer
"Changing Linkage" as mentioned in your edit would I suspect be moving the C code from a *PGM object into a *SRVPGM object (for bind-by-reference use) or *MODULE object (bind-by-copy).
ILE Procedures (aka Functions) can return values.
For ILE C/C++ calling C/C++ PGM
The following is mentioned in the ILE C/C++ Programmer's Guide..
But I don't think that will help with COBOL calling C/C++.