免费注册 查看新帖 |

Chinaunix

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

如何传参数 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-10-28 14:07 |只看该作者 |倒序浏览
C     *ENTRY        PLIST                                            
C                   PARM                    a                     8 0   
C                   PARM                    b                     4      
C                   PARM                    c                      6 0   
C                   PARM                    d                     2



CALL PGM(AAA) PARM(35198524 'AAAA' 417693 'AA')



出错   Decimal-data error occurred (C G D F).  
Cause . . . . . :   RPG procedure AAA in program BBB/AAA found a        
  decimal-data error at statement 350. A packed or zoned value does not      
  contain valid numeric data.  A digit and/or sign is not valid.              
Recovery  . . . :   Contact the person responsible for program maintenance to
  determine the cause of the problem. A response of 'D' will cause an RPG     
  formatted dump which may be useful in determining which field has the      
  decimal-data error. However, it may be an intermediate value that has the   
  error, if the error occurred in an expression.                              
Possible choices for replying to message . . . . . . . . . . . . . . . :      

传数字参数出错,是否要在文件中定义什么,请高手指点!

论坛徽章:
0
2 [报告]
发表于 2005-10-28 14:26 |只看该作者

如何传参数

CALL PGM(AAA) PARM(X'035198524F'  'AAAA'  X'0417693F'  'AA')

论坛徽章:
0
3 [报告]
发表于 2005-10-28 14:30 |只看该作者

如何传参数

http://bbs.chinaunix.net/forum/viewtopic.php?t=294411

论坛徽章:
0
4 [报告]
发表于 2005-10-28 14:34 |只看该作者

如何传参数

在北美许多程序员喜欢用FDA进行程序间参数传递。这就不会发生上诉问题。

论坛徽章:
0
5 [报告]
发表于 2005-10-28 15:15 |只看该作者

如何传参数

通过交互式方式直接调用还有一种方法哈:

把数值参数定义成长度(15 5),就可以直接输入参数调用了哈.

把你的程序改改:
C     *ENTRY        PLIST                                             
C                   PARM                    a                    15 5     
C                   PARM                    b                     4      
C                   PARM                    c                    15  5
C                   PARM                    d                     2

再按你的方法调用:
CALL PGM(AAA) PARM(35198524 'AAAA' 417693 'AA')

应该没有问题的哈.

论坛徽章:
0
6 [报告]
发表于 2005-10-28 16:01 |只看该作者

如何传参数

谢谢各位

论坛徽章:
0
7 [报告]
发表于 2005-10-28 16:57 |只看该作者

如何传参数

还有一种方式:

在D表中定义一个变量组与调用参数一致。就可以在call直接使用。这样就不用考虑x(    )问题了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP