方法一,Nomain,调用RPGLE subprocedure
RPGLE Source CBL05
FMT H HKeywords++++++++++++++++++++++++++++++++++++++++
*************** Beginning of data ***************
0001.00 H NOMAIN
0002.00 DC1 PR
0003.00 DSTR1 20A
0004.00 *
0005.00 PC1 B EXPORT
0006.00 DC1 PI
0007.00 DSTR1 20A
0008.00 C STR1 DSPLY
0009.00 PC1 E
****************** End of data ******************
用15 CRTRPGMOD编译为Module
COBOL Source
FMT C* ......*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5
*************** Beginning of data ****************
0001.00 *
0002.00 IDENTIFICATION DIVISION.
0003.00 PROGRAM-ID. CBL06.
0004.00 AUTHOR. ZHAOQIAN.
0005.00 ENVIRONMENT DIVISION.
0006.00 CONFIGURATION SECTION.
0007.00 Source-Computer. IBM-ISERIES.
0008.00 Object-Computer. IBM-ISERIES.
0009.00 INPUT-OUTPUT SECTION.
0010.00 FILE-CONTROL.
0011.00 DATA DIVISION.
0012.00 Working-Storage Section.
0013.00 01 DSP-STRING PIC X(20) VALUE ALL "Q".
0014.00 PROCEDURE DIVISION.
0015.00 MAIN-PROCEDURE.
0016.00 CALL PROCEDURE "C1" USING DSP-STRING. //注意这里要用真正的Procedure Name
0017.00 STOP RUN.
****************** End of data *******************
用15 CRTCBLMOD编译为Module
创建PGM: CRTPGM PGM(QIANTEST/CBL06) MODULE(QIANTEST/CBL06 QIANTEST/CBL05)
调试过程中出过一些小的编译错误, 排错时发现COBOL的编译信息跟RPGLE不太一样,不过很类似,分析起来也不是很吃力. 最常出现的错误是COBOL中的单词太长了,老是出现笔误....
方法二,调用RPGLE main Procedure
RPGLE Source: CBL07
FMT * *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...
*************** Beginning of data ***************
0001.00 *
0002.00 DSTR1 S 20A
0003.00 *
0004.00 C *ENTRY PLIST
0005.00 C PARM STR1
0006.00 C STR1 DSPLY
0007.00 C EVAL *INLR=*ON
0008.00 C RETURN
****************** End of data ******************
COBOL Source: CBL06
FMT C* ......*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 .
*************** Beginning of data ******************
0001.00 *
0002.00 IDENTIFICATION DIVISION.
0003.00 PROGRAM-ID. CBL06.
0004.00 AUTHOR. ZHAOQIAN.
0005.00 ENVIRONMENT DIVISION.
0006.00 CONFIGURATION SECTION.
0007.00 Source-Computer. IBM-ISERIES.
0008.00 Object-Computer. IBM-ISERIES.
0009.00 INPUT-OUTPUT SECTION.
0010.00 FILE-CONTROL.
0011.00 DATA DIVISION.
0012.00 Working-Storage Section.
0013.00 01 DSP-STRING PIC X(20) VALUE ALL "Q".
0014.00 PROCEDURE DIVISION.
0015.00 MAIN-PROCEDURE.
0016.00 CALL PROCEDURE "CBL07" USING DSP-STRING. //注意这里要用真正的Procedure Name
0017.00 STOP RUN.
****************** End of data *********************
编译命令同方法一.
这里要注意RPGLE Source了,因为这里的RPGLE是个main Procedure,因此其Procedure Name就是程序本身,即RPG MODULE本身的名字.
阅读(1864) | 评论(0) | 转发(0) |