Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1268101
  • 博文数量: 287
  • 博客积分: 11000
  • 博客等级: 上将
  • 技术积分: 3833
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-16 08:43
文章分类
文章存档

2013年(15)

2012年(17)

2011年(17)

2010年(135)

2009年(85)

2008年(18)

分类: 系统运维

2009-07-18 12:45:08

QZRUCLSP API, 无bind,动态调用服务程序 API(例一)
 
The Call Service Program Procedure (QZRUCLSP) API allows an unbound call to an ILE procedure exported by a service program.
 
    服务程序是通过binddir生成。应用程序在正常情况下,如果要call服务程序中的一个服务应用程序,通常的情况下,在编译这个程序时,系统要通过binddir来检查这个服务应用程序,建立起bind静态链,才能编译通过。
 
    QZRUCLSP api,可以使用于一种特例情况,如copy或恢复的程序直接调用服务应用程序,即使这个bind链已经不存在了。可能这个应用程序无法再编译,如没有源代码。
 
    所以静态call,bind call,变成了动态call。
 
    但是这call,又与普通的程序的动态call不同,因为是程序call一个moudle。
 
Call Service Program Procedure
Program: VARPROC1
     H DFTACTGRP(*NO) ACTGRP(*NEW)
      *
      *  This program demonstrates using the QZRUCLSP API to do "soft
      *  coded" calls to routines in the MSGSRV service program.
      *                                Scott Klement, Nov 6, 2003
      *
      *
      * Compile me with:
      *    CRTBNDRPG VARPROC1 SRCFILE(xxx/xxx)
      *  (Note that you do NOT have to bind the MSGSRV *SRVPGM!)
      *
      * Call me with:
      *   CALL VARPROC1 PARM('COMPMSG' 'THIS IS MY COOL MESSAGE' 23)
      *   CALL VARPROC1 PARM('DIAGMSG' 'THIS IS MY COOL MESSAGE' 23)
      *   CALL VARPROC1 PARM('ESCAPEMSG' 'THIS IS MY COOL MESSAGE' 23)
      *   CALL VARPROC1 PARM('STATUSMSG' 'THIS IS MY COOL MESSAGE' 23)
      *
      *  Note that the output from DIAGMSG will go to the job log.
      *
      *
      * API error code structure
      *
     D dsEC            DS
     D   dsEC_BytesP                 10I 0 inz(%size(dsEC))
     D   dsEC_BytesA                 10I 0 inz(0)
     D   dsEC_MsgID                   7A
     D   dsEC_Resvd                   1A
     D   dsEC_MsgDta                240A
      *
      * Call Service Program Procedure API (QZRUCLSP)
      *
     d QZRUCLSP        pr                  extpgm('QZRUCLSP')
     d  QualSrvPgm                   20A   const
     d  ExportName                 4096A   options(*varsize) const
     d  RtnValFmt                    10I 0 const
     d  ParmsFmt                     10I 0 dim(256) options(*varsize)
     d  NumOfParms                   10I 0 const
     d  Errorcode                  1024a   options(*varsize)
     d  ReturnValue                  10I 0 options(*nopass)
     d  Parameter1                  256A   options(*nopass)
     d  Parameter2                   10I 0 options(*nopass)
      *
      * Parameter/Return types to use with QZRUCLSP API
      *
     d RETTYPE_NONE    C                   0
     d RETTYPE_INT     C                   1
     d RETTYPE_PTR     C                   2
     d RETTYPE_INTERR  C                   3
     d PARMTYPE_INT    C                   1
     d PARMTYPE_PTR    C                   2
     d SrvPgm          s             10A   inz('MSGSRV')
     d SrvPgmLib       s             10A   inz('*LIBL')
     d Procedure       s             32A
     d ParmType        s             10I 0 dim(2)
     d RtnVal          s             10I 0
     D Message         s            256A
     D Length          s             15P 5
     D IntLen          s             10I 0
     D Msg             s             52A
     c     *entry        plist
     c                   parm                    Procedure
     c                   parm                    Message
     c                   parm      %
阅读(1529) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~