Cobol 动态调用如何使用组作为程序标识符来工作?
我有以下调用语句:
038060 CALL PROG USING
038070 DFH
038080 L000
038090 ZONE-E
038100 ZONE-S.
此调用是动态的并使用PROG。
PROG 是一个定义为的组:
018630 01 XX00.
018640 10 PROG.
018650 15 XX00-S06 PICTURE X(6)
018660 VALUE SPACE.
018670 15 XX00-S02 PICTURE X(2)
018680 VALUE SPACE.
018690 10 XX00-S92 PICTURE 9(02)
018700 VALUE ZERO.
018710 10 XX00-S91 PICTURE 9(1)
018720 VALUE ZERO.
018730 10 XX00-S9Z PICTURE 9(1)
018740 VALUE ZERO.
018750 10 XX00-9B0 PICTURE X(05)
018760 VALUE SPACE.
018770 10 XX00-0B0 PICTURE X(02)
018780 VALUE SPACE.
018790 10 XX00-BB1 PICTURE X(01)
018800 VALUE SPACE.
018810 10 XX00-SFN PICTURE X(07)
I cut here but there is a lot of field after...
似乎要使用的实际 progname 存储在:
XX00-S06
和
XX00-S02
我还有其他情况,其中名称位于 3 或 4 个字段,并且程序名称长度并不总是 8。
所以我的问题是 Cobol 如何知道在组中哪里选择好的程序名称?解析规则是什么?
配置:我使用Microfocus Net Express编译器,环境是UniKix。
I have the following call statement :
038060 CALL PROG USING
038070 DFH
038080 L000
038090 ZONE-E
038100 ZONE-S.
This call is dynamic and use PROG.
PROG is a group defined as :
018630 01 XX00.
018640 10 PROG.
018650 15 XX00-S06 PICTURE X(6)
018660 VALUE SPACE.
018670 15 XX00-S02 PICTURE X(2)
018680 VALUE SPACE.
018690 10 XX00-S92 PICTURE 9(02)
018700 VALUE ZERO.
018710 10 XX00-S91 PICTURE 9(1)
018720 VALUE ZERO.
018730 10 XX00-S9Z PICTURE 9(1)
018740 VALUE ZERO.
018750 10 XX00-9B0 PICTURE X(05)
018760 VALUE SPACE.
018770 10 XX00-0B0 PICTURE X(02)
018780 VALUE SPACE.
018790 10 XX00-BB1 PICTURE X(01)
018800 VALUE SPACE.
018810 10 XX00-SFN PICTURE X(07)
I cut here but there is a lot of field after...
It seems that actual progname to use is stored in :
XX00-S06
and
XX00-S02
I've also other cases where the name is on 3 or 4 fields, and the progname length is not always 8.
So my question is how Cobol know where to pick the good program name in the group? What are the resolution rules?
Configuration : I use Microfocus Net Express compiler and the environment is UniKix.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
COBOL 中的动态调用规则相当简单。给定类似的内容:
COBOL 将根据加载模块库解析当前存储在
WS-NAME
中的程序名称可用它基于
线性搜索。使用与
WS-NAME
匹配的第一个匹配的加载模块入口点名称。WS-NAME
的定义有多复杂或多简单并不重要。用于名称的总长度是
WS-NAME
的长度。例如:WS-NAME
由 3 个从属字段组成,总共 8 个字符。您可以单独填充这些或只是移动将某些内容纳入
WS-NAME
作为一个整体。如果WS-NAME
的长度小于 8 个字符,则尾随字符将为在任何接收字段上设置为空格。例如:
这里
WS-SHORT-NAME
只有 6 个字符长。将 WS-SHORT-NAME
移动到任何更长的PIC X
类型变量,如下所示:将导致 WS-NAME 的值为“AAAABB
bb” '(注意两个尾随空格)。图书馆检索期间对于匹配的入口点名称,尾随空格并不重要,因此您可以在 CALL 语句中使用
要么:
要么
他们将解析到相同的入口点。
我不确定 MicroFocus COBOL 的长度规则是什么,但是对于 IBM z/os 动态调用
程序名称不能超过 8 个字符(如果超过,名称将被截断为 8 个字符)。
Dynamic call rules in COBOL are fairly simple. Given something like:
COBOL will resolve the program name currently stored in
WS-NAME
against the load module librariesavailable to it based on
a linear search. The first matching load module entry point name that matches
WS-NAME
is used.It doesn't matter how complex, or simple, the definition of
WS-NAME
is. The total length used for the nameis whatever the length of
WS-NAME
is. For example:WS-NAME
is composed of 3 subordinate fields giving a total of 8 characters. You can populate these individually or just movesomething into
WS-NAME
as a whole. If the length ofWS-NAME
is less than 8 characters, the trailing characters will beset to spaces on any receiving field. For example:
Here
WS-SHORT-NAME
is only 6 characters long.MOVING WS-SHORT-NAME
to any longerPIC X
type variable as in:Will result in WS-NAME taking on the value 'AAAABB
bb' (note the two trailing spaces). During libary searchfor a matching entry point name, the trailing spaces are not significant so on the CALL statement you could use
either:
or
And they will resolve to the same entry point.
I am not sure what the length rules are for MicroFocus COBOL but, for IBM z/os dynamically called
program names cannot exceed 8 characters (if they do, the name is truncated to 8 characters).
我将向 NeilB 添加更多关于 Micro Focus COBOL 的具体信息。
仅供参考:PROGRAM-ID、ENTRY-POINTS 限制为 30-31 个字符(请检查文档中的“系统限制和编程限制”部分)。
I will add little more to NeilB with specific information about Micro Focus COBOL.
fyi: PROGRAM-ID, ENTRY-POINTS are restricted to 30-31 characters (check your "System Limits and Programming Restrictions" section in the docs).