免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2681 | 回复: 5
打印 上一主题 下一主题

qc2le的使用问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-09-04 16:10 |只看该作者 |倒序浏览
  1.      hdftactgrp(*no) actgrp(*new) bnddir('qc2le')
  2.      drand             pr            10i 0 extproc('rand')
  3.      dsrand            pr                  extproc('srand')
  4.      d seed                          10u 0 value
  5.      dgettimeofday     pr                  extproc('gettimeofday')
  6.      d timeval                        8a
  7.      d timezone                       8a
  8.      dtimeval          ds
  9.      d tv_secs                       10i 0
  10.      d tv_usecs                      10i 0
  11.      d                sds
  12.      djobno                  264    269
  13.      djunk             s              8a
  14.      depoch            s               z   inz(z'1970-01-01-00.00.00.000000')
  15.      dutc              s               z
  16.      ddate             s               d
  17.      dmicro            s              6s 0
  18.      ddatestr          s             10a
  19.      dmicrostr         s              6a
  20.      dseed             s             10u 0
  21.      dseedstr          s             10a
  22.      dnum              s             10i 0
  23.      d*i               s             10i 0
  24.      c                   callp     gettimeofday(timeval:junk)
  25.      c     epoch         adddur    tv_secs:*s    utc
  26.      c                   adddur    tv_usecs:*ms  utc
  27.      c                   move      utc           date
  28.      c     *iso          move      date          datestr
  29.      c     datestr       dsply
  30.      c                   extrct    utc:*ms       microstr
  31.      c                   move      micro         microstr
  32.      c     microstr      dsply
  33.      c                   eval      seedstr=%subst(datestr:9:1)
  34.      c                                    +%subst(microstr:6:1)
  35.      c                                    +%subst(jobno:6:1)
  36.      c                                    +%subst(datestr:10:1)
  37.      c                                    +%subst(microstr:2:1)
  38.      c                                    +%subst(jobno:5:1)
  39.      c                                    +%subst(microstr:1:1)
  40.      c                                    +%subst(microstr:3:3)
  41.      c                   move      seedstr       seed
  42.      c                   callp     srand(seed)
  43.      c*                  for       i=1 to 10
  44.      c                   eval      num=rand
  45.      c     num           dsply
  46.      c*                  endfor
  47.      c                   eval      *inlr=*on
复制代码

上面的程序通过14编译得到的提示信息是:
  1. Errors were found during the binding step. See the job log for more informa
  2. * * * * *   E N D   O F   B I N D   D I A G N O S T I C   M E S S A G E S
  3. Program TEST003 in library SRCLIN not created.                             
  4.           * * * * *   E N D   O F   C O M P I L A T I O N * * * * *        
  5.                                                                            
复制代码

通过15编译得到的提示信息是:
  1.   Msg id  Sv Number Message text                                          
  2. *RNF1324 20      2 Keywords DFTACTGRP, ACTGRP, or USRPRF are not allowed.
  3.         * * * * *   E N D   O F   M E S S A G E   S U M M A R Y   * * * * *
复制代码


不知道该怎样编译了
寻求大家的帮助

论坛徽章:
0
2 [报告]
发表于 2009-09-04 18:00 |只看该作者
actgrp(*new) 把这个去掉试试。

论坛徽章:
0
3 [报告]
发表于 2009-09-05 01:38 |只看该作者
或者改为actgrp(*caller)

论坛徽章:
0
4 [报告]
发表于 2009-09-07 10:41 |只看该作者
多谢afeng8848的回复

试着修改了一下
但是还是有问题

去掉了actgrp(*new)用15来编译时的提示为:
      1 hdftactgrp(*no) bnddir('qc2le')                                      
======> aaaaaaaaa                                                           
*RNF1324 20 a      000100  Keywords DFTACTGRP, ACTGRP, or USRPRF are not al


修改成actgrp(*caller)用15来编译时的提示为:
     1 hdftactgrp(*no) actgrp(*caller) bnddir('qc2le')                     
======> aaaaaaaaa      bbbbbb                                               
*RNF1324 20 a      000100  Keywords DFTACTGRP, ACTGRP, or USRPRF are not al
*RNF1324 20 b      000100  Keywords DFTACTGRP, ACTGRP, or USRPRF are not al


上面两种办法用14编译后的提示则都是:
Errors were found during the binding step. See the job log for more informa
  * * * * *   E N D   O F   B I N D   D I A G N O S T I C   M E S S A G E S  
Program TEST003 in library SRCLIN not created.                              
           * * * * *   E N D   O F   C O M P I L A T I O N * * * * *         



如果把dftactgrp(*no)和actgrp(*new)都去掉用15编译的话
成功生成了一个
                                                                 
Opt  Object      Type        Attribute   Text                    
     TEST003     *MODULE     RPGLE        


然后用了命令
crtpgm pgm(srclin/test3) module(srclin/test003)

结果没有成功
用dspjoblog看了一下
提示的信息为

4 > crtpgm pgm(srclin/test3) module(srclin/test003)   
    Binding directory qc2le in library *LIBL not found.
    Definition not found for symbol 'rand'.            
    Definition not found for symbol 'srand'.           
    Program TEST3 not created.                        


后来又尝试了
5 > crtpgm pgm(srclin/test3) module(srclin/test003 QSYS/QC2LE)         
    No modules found for the specified value of QC2LE in library QSYS.
    Program TEST3 not created.                                         
                                                                       


但是按照下面链接:
http://wiki.midrange.com/index.php/Using_QC2LE_procedures_in_ILE_RPG

输入了WRKBNDDIRE QSYS/QC2LE命令
                      Work with Binding Directory Entries                       
                                                                                
Binding Directory:   QC2LE          Library:   QSYS                           
                                                                                
Type options, press Enter.                                                     
   1=Add   4=Remove                                                            
                                                                                
                                                   --------Creation---------   
Opt     Object         Type        Library        Date           Time         
                                                                                
         QC2SYS         *SRVPGM     QSYS           02/20/02       09:10:38      
         QC2IO          *SRVPGM     QSYS           10/22/03       19:00:16      
         QC2UTIL1       *SRVPGM     QSYS           02/20/03       14:20:55      
         QC2UTIL2       *SRVPGM     QSYS           02/20/02       09:10:48      
         QC2UTIL3       *SRVPGM     QSYS           05/01/02       17:48:19      
         QC2IFS         *SRVPGM     QSYS           02/20/03       16:09:35      
         QC2POSIX       *SRVPGM     QSYS           11/07/03       13:42:30      
         QC2LOCAL       *SRVPGM     QSYS           02/20/02       09:10:35      
                                                                        More...
Parameters or command                                                         
===>                                                                           
F3=Exit   F4=Prompt   F9=Retrieve   F5=Refresh   F12=Cancel   F17=Top         
F18=Bottom                                                                     
Already at top of area.                                                        

的确有反应

论坛徽章:
0
5 [报告]
发表于 2009-09-07 10:58 |只看该作者
终于成功了!
最后是把程序修改成了这样:
     hdftactgrp(*no) bnddir('QC2LE')
     drand             pr            10i 0 extproc('rand')
     dsrand            pr                  extproc('srand')
     d seed                          10u 0 value
     dgettimeofday     pr                  extproc('gettimeofday')
     d timeval                        8a
     d timezone                       8a
     dtimeval          ds
     d tv_secs                       10i 0
     d tv_usecs                      10i 0
     d                sds
     djobno                  264    269
     djunk             s              8a
     depoch            s               z   inz(z'1970-01-01-00.00.00.000000')
     dutc              s               z
     ddate             s               d
     dmicro            s              6s 0
     ddatestr          s             10a
     dmicrostr         s              6a
     dseed             s             10u 0
     dseedstr          s             10a
     dnum              s             10i 0
     d*i               s             10i 0
     c                   callp     gettimeofday(timeval:junk)
     c     epoch         adddur    tv_secs:*s    utc
     c                   adddur    tv_usecs:*ms  utc
     c                   move      utc           date
     c     *iso          move      date          datestr
     c     datestr       dsply
     c                   extrct    utc:*ms       microstr
     c                   move      micro         microstr
     c     microstr      dsply
     c                   eval      seedstr=%subst(datestr:9:1)
     c                                    +%subst(microstr:6:1)
     c                                    +%subst(jobno:6:1)
     c                                    +%subst(datestr:10:1)
     c                                    +%subst(microstr:2:1)
     c                                    +%subst(jobno:5:1)
     c                                    +%subst(microstr:1:1)
     c                                    +%subst(microstr:3:3)
     c                   move      seedstr       seed
     c                   callp     srand(seed)
     c*                  for       i=1 to 10
     c                   eval      num=rand
     c     num           dsply
     c*                  endfor
     c                   return

貌似是bnddir('QC2LE')中QC2LE的大小写问题
怎么会是这样

论坛徽章:
0
6 [报告]
发表于 2009-09-07 13:12 |只看该作者
果然是大小写的问题
尝试着测试了一下一个新程序
     hdftactgrp(*no) bnddir('QC2LE')
     dgettimeofday     pr            10i 0 extproc('gettimeofday')
     d timeval                        8a
     d timezone                       8a
     dtimeval          ds
     d tv_sec                        10i 0
     d tv_usec                       10i 0
     d                sds
     djunk             s              8a
     dt1               s             20i 0
     dt2               s             20i 0
     dt                s             20  6
     dst               s             30a
     da                s             10i 0
     c                   callp     gettimeofday(timeval:junk)
     c                   eval      t1=tv_sec*1000000+tv_usec
     c                   do        100000
     c                   do        500
     c                   eval      a=1
     c                   enddo
     c                   enddo
     c                   callp     gettimeofday(timeval:junk)
     c                   eval      t2=tv_sec*1000000+tv_usec
     c                   eval      t=(t2-t1)/1000000
     c                   eval      st='use time: '+%char(t)+' sec'
     c     st            dsply
     c                   return
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP