找不到符号 'QMHSNDPM' 的定义

Definition not found for symbol 'QMHSNDPM'

我正在学习 Scott Klement 关于使用 RPGLE 进行 IFS 编程的教程。我面临以下问题。我也添加了代码片段。请协助。

Ownership of object WITHERRH in QTEMP type *MODULE changed.            
*SRVPGM object QZDMMDTA in library QSOC not found.                     
Definition not found for symbol 'QMHSNDPM'.                            
Definition not found for symbol 'QMHSNDPM'.                            
Program WITHERRH in library ABCLIBL not created.     

PR 是在此复制源中定义的。

 /if not defined(ERRNO_H)                                          
D strerror        PR              *   extproc('strerror')          
D  errnum                       10I 0 value                        
 /define ERRNO_H                                                   
 /endif                                                            

 /if defined(ERRNO_LOAD_PROCEDURE)                                 
P die             B                                                
D die             PI              N                                
D  msg                         256A   const                        

D QMHSNDPM        PR                  extproc('QMHSNDPM')          
D  messageId                     7A   const                        
D  qualMsgF                     20A   const                        
D  msgData                     256A   const                        
D  msgDataLen                   10I 0 const                        
D  msgType                      10A   const                  
D  callSktEnt                   10A   const                  
D  callSktCnt                   10I 0 const                  
D  messageKey                    4A                          
D  errorCode                   256A                          

D dsEC            DS                                         
D  dsECBytesP             1      4I 0 inz(%size(dsEC))       
D  dsECBytesA             5      8I 0 inz(0)                 
D  dsECMsgId              9     15                           
D  dsECReserv            16     16                           
D  dsECMsgData           17    256                           
D msgLen          S             10I 0                        
D theKey          S              4A                          

       msgLen = %checkr(msg:' ');                            
       if msgLen < 1;                                        
          return *off;                                         
       endif;                                                  

       callP  QMHSNDPM('CPF9897':'QCPFMSG   *LIBL':msg:msgLen: 
                       '*ESCAPE':'*':3:theKey:dsEC);           
       return *off;                                            
P                 E                                            

主程序添加了QC2LE绑定目录; 'die' 过程调用如下,

H dftactgrp(*no) actgrp(*new) bnddir('QC2LE')    

D/copy ABCLIBL/QIFSSRC,IFSIO_H                 
D/copy ABCLIBL/QIFSSRC,ERRNO_H               
.....
if write(fd:%addr(wrdata):%size(wrdata)) < 1; 
   errMsg = %str(strerror(errno));            
   callP close(fd);                           
   callP die('open(): ' + errMsg);            
endif;                                        

正如@user2338816 所说,QMHSNDPM 是一个外部程序而不是过程:

D QMHSNDPM        PR                  extpgm('QMHSNDPM')

大多数 API 是外部程序而不是过程。当它们不是外部程序时,很容易从文档中看出。

例如:Dump Module Variables

有了这个 API,您可以将您的程序绑定到 QTEDMPV 服务程序,然后使用 extproc 来引用该过程。

D DumpVariables   PR                  extproc('QteDumpModuleVariables')