亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1760 | 回復(fù): 1
打印 上一主題 下一主題

調(diào)用程序的錯誤信息,請大俠們幫忙解決 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2012-07-24 11:06 |只看該作者 |倒序瀏覽
本帖最后由 seouldeng 于 2012-07-24 11:08 編輯

引用  PASSTRU的博客文章  
目的:

本例子演示RPGLE使用服務(wù)程序(*SRVPGM)通過指針傳遞參數(shù)進行調(diào)用。調(diào)用程序可以通過bnddir對服務(wù)程序進行直接調(diào)用,無需服務(wù)程序與子系統(tǒng)直接關(guān)聯(lián)。



服務(wù)程序:TSRV.*SRVPGM

服務(wù)程序下掛服務(wù)應(yīng)用程序M1.*Module

BNDDIR:BTEST

測試程序:TEST.*PGM



M1.RPGLE:(用15編譯成M1.*Module,放在MyLib目錄下。)

d M1              Pr                              

d  Ptr1                           *               

d  Ptr2                           *               

*                                                

d C_Str              s             20               

d C_String        s             20    based(Ptr1)

d Ptr1            s               *               

d Ptr2            s               *               

*                                                

c     *entry        plist                        

c                   parm                    Ptr1  

c                   parm                    Ptr2  

/free                                            

     C_Str = C_String ;                           

     C_Str = 'Hello! ' + C_Str ;                  

     Ptr2 = %addr(C_Str) ;                        

                                                  

*inlr = *on ;            

return ;

/end-free



服務(wù)程序TSRV.rpgle:(用15編譯成TSRV.*Module,放在MyLib目錄下)

/free

Return ;

/end-free



服務(wù)程序TSRV下的服務(wù)應(yīng)用程序定義bnd.rpgle文件:(放在MYLIB/BNDSRC目錄下,無需編譯)

STRPGMEXP SIGNATURE('TSRV')

   EXPORT SYMBOL('M1')     

ENDPGMEXP                  



創(chuàng)建服務(wù)程序TSRV.*srvpgm:(編譯結(jié)果放在MyLib目錄下)

CRTSRVPGM SRVPGM(MYLIB/TSRV)           

          MODULE(MYLIB/TSRV  MYLIB/M1)

          SRCFILE(MYLIB/BNDSRC)      



創(chuàng)建BTEST. *BNDDIR(放在MyLib目錄下):

CRTBNDDIR BNDDIR(MYLIB/BTEST)



加載服務(wù)程序TSRV.*srvpgm到BTEST bnddir下:

ADDBNDDIRE BNDDIR(MYLIB/BTEST) +   

             OBJ((MYLIB/TSRV))



或者用WRKBNDDIR對BTEST.*bnddir進行交互操作。



測試程序TEST.rpgle:(用14進行編譯,放在MYLIB下)

H BNDDIR('BTEST')                                 

H DFTACTGRP(*NO)                                 

H OPTION(*ShowCpy)                                

*                                                

d M1              Pr                       ExtPgm('M1')                                 

d  Ptr1                           *               

d  Ptr2                           *               

*                                                

d C_Str              s             20    inz('Body')

d C_String        s             20    based(Ptr2)

d Ptr1            s               *               

d Ptr2            s               *               

*                                                

/free                                            

     Ptr1 = %addr(C_Str) ;                        

     callp M1(Ptr1tr2) ;                        

                                                  

    *inlr = *on ;                                 

return ;                                      



/end-free

最后一步調(diào)用程序TEST,報錯
Message . . . . :   Error occurred while calling program or procedure *LIBL/M
  (C G D F).                                                                 
Cause . . . . . :   RPG procedure TEST in program POPGLIB/TEST at statement 1
  attempted to call program or procedure *LIBL/M1, but was unable to access  
  the program or procedure, the library, or a required service program. If th
  name is *N, the call was a bound call by procedure pointer.               
Recovery  . . . :   Check the job log for more information on the cause of th
  error and contact the person responsible for program maintenance.         
Possible choices for replying to message . . . . . . . . . . . . . . . :     
  D -- Obtain RPG formatted dump.                                            
  S -- Obtain system dump.                                                   
  G -- Continue processing at *GETIN.                                       

單步進去,CALLP那里報錯
Message . . . . :   Cannot resolve to object M1. Type and Subtype X'0201'   
  Authority X'0000'.                                                        
Cause . . . . . :   Either a system pointer or a data pointer can not be   
  resolved.                                                                 
    For a system pointer, it can not be resolved to object M1, type and     
  subtype X'0201', authorization X'0000', because either the named object wa
  not in any context referred to or the correct object was located but the  
  user profile did not have the required authority.                        
    The object types for common type or subtype codes follow:               
    -- 0100-Access group, 0201-Program, 0401-Library,                       
    -- 0701-Journal receiver, 0801-User profile, 0901-Journal,              
    -- 0B90-Data space, 0C90-Data space index, 0D50-Data base file member,  

不知道我是什么原因?qū)е鲁鲥e的呢?

論壇徽章:
0
2 [報告]
發(fā)表于 2012-07-24 13:22 |只看該作者
把調(diào)用程序的關(guān)鍵字ExtPgm('M1')  更改為EXTPROC('M1')  ,程序就運行正常了。不過個人還不是很理解為什么要改為EXTPROC,雖然EXTPROC是調(diào)用服務(wù)程序的M1模塊,M1是*MODULE類型。但是通過SRVPGM連接起來的M1不能夠用EXTPGM調(diào)用?不知道有沒有大俠知道?
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP