简体   繁体   English

如何在AS / 400 RPG中检查Pgm的堆栈?

[英]How to check the stack of the Pgm in AS/400 RPG?

I have a doubt about how to find the stack of the pgm? 我对如何找到pgm的堆栈有疑问?

EX: We have three pgms PGM 1 , PGM 2, PGM 3. 例如:我们有三个pgms PGM 1,PGM 2,PGM 3。

However PGM 2 called by PGM1 and PGM 3 called by PGM 2. 但是,PGM1调用的PGM 2和PGM 2调用的PGM 3。

how we check that PGM 3 called by PGM 2 as we know only about the PGM 3. we don't about the other pgms. 我们仅了解PGM 3时如何检查PGM 2调用的PGM 3,而不了解其他pgms。

Is there are command to check the stack of the PGM . 是否有命令检查PGM的堆栈。 Which PGM is called by which PGM without checking the Source code. 哪个PGM由哪个PGM调用而无需检查源代码。

Thank you! 谢谢! Mohd Wasim 莫赫德·瓦西姆(Mohd Wasim)

Check the QWVRCSTK API : qwvrcstk API , That's the equivalent of JOB information option 11=Display Call Stack 检查QWVRCSTK API: qwvrcstk API ,这等效于JOB信息选项11 = Display Call Stack

Example here : RPGLE find Calling program name 此处示例: RPGLE查找调用程序名称

While the program (PGM3) is active you can display it's call stack. 在程序(PGM3)处于活动状态时,您可以显示其调用堆栈。 From WRKACTJOB screen place a "5=Work With" next to the entry, then from the next menu option "11=Display Call Stack". 在WRKACTJOB屏幕上,在条目旁边放置一个“ 5 = Work With”,然后在下一个菜单选项“ 11 = Display Call Stack”中放置。 The active program should be at (or near) the end of the list. 活动程序应位于列表的末尾(或附近)。

Of course that doesn't guarantee that is the only pathway the program can be called (that seems impossible to know without scanning the source, or a using change management utility). 当然,这并不能保证这是可以调用程序的唯一途径(如果不扫描源代码或使用变更管理实用程序,这似乎是不可能知道的)。

If you want to check this programatically, you can send a program message to the programs call stack entry. 如果要以编程方式进行检查,则可以将程序消息发送到程序调用堆栈条目。

SNDPGMMSG  MSG(' ') TOPGMQ(*SAME &PGMNAME) KEYVAR(&KEYVAR)

If you get a CPF2469 or CPF2479 message, the program is NOT on the call stack. 如果收到CPF2469或CPF2479消息,则程序不在调用堆栈上。

If you don't get an error, then the program is on the call stack. 如果没有错误,则程序在调用堆栈中。

You can use the &KEYVAR variable to remove the message you just sent off the message queue. 您可以使用&KEYVAR变量删除刚刚从消息队列发送的消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM