在 AS/400 中编译 COBOL 时出错:由于源语句,程序 PROGRAM 未在库 TEST1 中创建

发布于 2025-01-16 20:31:36 字数 4356 浏览 0 评论 0原文

当我尝试以 PUB400.COM IBM i 系列免费托管的成员身份编译 cobol 程序时,出现错误。

我遵循与此视频中描述的示例相同的示例:

https://onx.la/4521a

编译时,我收到此错误消息:

由于源语句,程序 USOVAR 未在库 TEST1 中创建 +

但我不知道如何获取有关该消息的更多信息以及如何获取日志错误或调试尚未编译的成员。

这是代码:

*************** Beginning of data ************************************* 
0001.00        IDENTIFICATION DIVISION.                                         
0002.00        PROGRAM-ID.    USOVAR                                            
0003.00        AUTHOR.        REINALDO ENRIQUE URQUIJO YANIEZ.                  
0004.00        DATE-WRITTEN.  24/03/2022.                                       
0005.00        ENVIRONMENT DIVISION.                                            
0006.00        DATA DIVISION.                                                   
0007.00        WORKING-STORAGE SECTION.                                         
0008.00        77 WKS-NOMBRE                 PIC A(30).                         
0009.00        01 WKS-REGISTRO-EMPLEADO.                                        
0010.00           02 WKS-NOM-EMP.                                               
0011.00              03 WKS-NOMBRE-TRAB      PIC A(20)                          
0012.00                                        VALUE "PEDRO".                   
0013.00              03 WKS-APELLIDO-PATERNO PIC A(20)                          
0014.00                                        VALUE "PEREZ".                   
0015.00              03 WKS-APELLIDO-MATERNO PIC A(20)                          
0016.00                                        VALUE "ROJAS".                   
FMT CB ......-A+++B+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
0017.00           02 WKS-EDAD                PIC 9(02)                          
0018.00                                        VALUE 48.                        
0019.00           02 WKS-SALARIO             PIC 9(05)V99                       
0020.00                                        VALUE 788.22.                    
0021.00        66 WKS-APELLIDOS-TRAB RENAMES                                    
0022.00              WKS-APELLIDO-PATERNO THRU WKS-APELLIDO-MATERNO.            
0023.00        01 WKS-BANDERA PIC 9(01).                                        
0024.00           88 WKS-TRUE  VALUE 1.                                         
0025.00           88 WKS-FALSE VALUE 0.                                         
0026.00        77 GASTOS                     PIC 9(05)V99.                      
0027.00        77 WS-HORAS                   PIC 9(10).                         
0028.00        01 WKS-DIRECCION              PIC X(30)                          
FMT CB ......-A+++B+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
0029.00                                        VALUE "AV SIEMPRE VIVA 123".     
0030.00        PROCEDURE DIVISION.                                              
0031.00        00001-PRIMER-SECCION SECTION.                                    
0032.00        00001-MIPARRAFO.                                                 
0033.00            DISPLAY "BIENVENIDO AL PROGRAMA".                            
0034.00            DISPLAY "PROGRAMA DE VARIABLES"                              
0035.00            ACCEPT WKS-NOMBRE.                                           
0036.00            DISPLAY "HOLA,"       WKS-NOMBRE.                            
0037.00            DISPLAY "REGISTRO EMPLEADO: " WKS-REGISTRO-EMPLEADO.         
0038.00            DISPLAY "EDAD: "      WKS-EDAD.                              
FMT CB ......-A+++B+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
0039.00            DISPLAY "NOMBRE: "    WKS-NOM-TRAB.                          
0040.00            DISPLAY "APELLIDOS: " WKS-APELLIDOS-TRAB.                    
0041.00            DISPLAY "DIRECCION: " WKS-DIRECCION.                         
0042.00            DISPLAY "GASTOS: "    WKS-GASTOS.                            
0043.00            DISPLAY "BANDERA: "   WKS-BANDERA.                           
0044.00            STOP "PAUSA".                                                
0045.00            STOP RUN.                                                    
    ****************** End of data ****************************************

I get an error when I'm trying to compile a cobol program as a member in the PUB400.COM IBM i Series free hosting.

I follow an example same as descripted in this video:

https://onx.la/4521a

When compile, I get this error message:

Program USOVAR not create in library TEST1 because of source statement +

But I don't know how to get more information about the message and how to get the log error or debug a member that is not compiled yet.

This is the code:

*************** Beginning of data ************************************* 
0001.00        IDENTIFICATION DIVISION.                                         
0002.00        PROGRAM-ID.    USOVAR                                            
0003.00        AUTHOR.        REINALDO ENRIQUE URQUIJO YANIEZ.                  
0004.00        DATE-WRITTEN.  24/03/2022.                                       
0005.00        ENVIRONMENT DIVISION.                                            
0006.00        DATA DIVISION.                                                   
0007.00        WORKING-STORAGE SECTION.                                         
0008.00        77 WKS-NOMBRE                 PIC A(30).                         
0009.00        01 WKS-REGISTRO-EMPLEADO.                                        
0010.00           02 WKS-NOM-EMP.                                               
0011.00              03 WKS-NOMBRE-TRAB      PIC A(20)                          
0012.00                                        VALUE "PEDRO".                   
0013.00              03 WKS-APELLIDO-PATERNO PIC A(20)                          
0014.00                                        VALUE "PEREZ".                   
0015.00              03 WKS-APELLIDO-MATERNO PIC A(20)                          
0016.00                                        VALUE "ROJAS".                   
FMT CB ......-A+++B+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
0017.00           02 WKS-EDAD                PIC 9(02)                          
0018.00                                        VALUE 48.                        
0019.00           02 WKS-SALARIO             PIC 9(05)V99                       
0020.00                                        VALUE 788.22.                    
0021.00        66 WKS-APELLIDOS-TRAB RENAMES                                    
0022.00              WKS-APELLIDO-PATERNO THRU WKS-APELLIDO-MATERNO.            
0023.00        01 WKS-BANDERA PIC 9(01).                                        
0024.00           88 WKS-TRUE  VALUE 1.                                         
0025.00           88 WKS-FALSE VALUE 0.                                         
0026.00        77 GASTOS                     PIC 9(05)V99.                      
0027.00        77 WS-HORAS                   PIC 9(10).                         
0028.00        01 WKS-DIRECCION              PIC X(30)                          
FMT CB ......-A+++B+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
0029.00                                        VALUE "AV SIEMPRE VIVA 123".     
0030.00        PROCEDURE DIVISION.                                              
0031.00        00001-PRIMER-SECCION SECTION.                                    
0032.00        00001-MIPARRAFO.                                                 
0033.00            DISPLAY "BIENVENIDO AL PROGRAMA".                            
0034.00            DISPLAY "PROGRAMA DE VARIABLES"                              
0035.00            ACCEPT WKS-NOMBRE.                                           
0036.00            DISPLAY "HOLA,"       WKS-NOMBRE.                            
0037.00            DISPLAY "REGISTRO EMPLEADO: " WKS-REGISTRO-EMPLEADO.         
0038.00            DISPLAY "EDAD: "      WKS-EDAD.                              
FMT CB ......-A+++B+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
0039.00            DISPLAY "NOMBRE: "    WKS-NOM-TRAB.                          
0040.00            DISPLAY "APELLIDOS: " WKS-APELLIDOS-TRAB.                    
0041.00            DISPLAY "DIRECCION: " WKS-DIRECCION.                         
0042.00            DISPLAY "GASTOS: "    WKS-GASTOS.                            
0043.00            DISPLAY "BANDERA: "   WKS-BANDERA.                           
0044.00            STOP "PAUSA".                                                
0045.00            STOP RUN.                                                    
    ****************** End of data ****************************************

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别靠近我心 2025-01-23 20:31:36

我根据您的代码创建了一个名为 TEST0017CB 的源成员。 Srctype CBLLE。

使用 PDM 中的选项 14 编译代码。 CRTBNDCBL

CRTBNDCBL ??PGM(WLKLIB/TEST0017CB)
          ?*SRCFILE(steve/QRPGLESRC)
          ?*SRCMBR(TEST0017CB)
          ??REPLACE(*YES)

编译失败。运行 WRKJOB 命令。选项 4. 假脱机文件。编译输出列表是列表中的最后一个假脱机文件。使用选项 5 显示编译列表。

纠正了这些编译错误的

    STMT
 *     2  MSGID: LNC0810  SEVERITY: 10  SEQNBR:  000200
          Message . . . . :   Module name 'TEST0017CB' does not match outermost
            PROGRAM-ID name 'USOVAR'. Accepted.
 *    30  MSGID: LNC1326  SEVERITY: 30  SEQNBR:  003900
          Message . . . . :   'WKS-NOM-TRAB' not defined name. Statement or
            clause ignored.
 *    33  MSGID: LNC1326  SEVERITY: 30  SEQNBR:  004200
          Message . . . . :   'WKS-GASTOS' not defined name. Statement or clause

源代码:

        IDENTIFICATION DIVISION.
        PROGRAM-ID.    TEST0017CB.
        AUTHOR.        REINALDO ENRIQUE URQUIJO YANIEZ.
        DATE-WRITTEN.  24/03/2022.
        ENVIRONMENT DIVISION.
        DATA DIVISION.
        WORKING-STORAGE SECTION.
        77 WKS-NOMBRE                 PIC A(30).
        01 WKS-REGISTRO-EMPLEADO.
           02 WKS-NOM-EMP.
             03 WKS-NOMBRE-TRAB      PIC A(20)
                                        VALUE "PEDRO".
             03 WKS-APELLIDO-PATERNO PIC A(20)
                                        VALUE "PEREZ".
              03 WKS-APELLIDO-MATERNO PIC A(20)
                                        VALUE "ROJAS".
           02 WKS-EDAD                PIC 9(02)
                                        VALUE 48.
           02 WKS-SALARIO             PIC 9(05)V99
                                        VALUE 788.22.
        66 WKS-APELLIDOS-TRAB RENAMES
              WKS-APELLIDO-PATERNO THRU WKS-APELLIDO-MATERNO.
        01 WKS-BANDERA PIC 9(01).
           88 WKS-TRUE  VALUE 1.
           88 WKS-FALSE VALUE 0.
        77 GASTOS                     PIC 9(05)V99.
        77 WS-HORAS                   PIC 9(10).
        01 WKS-DIRECCION              PIC X(30)
                                        VALUE "AV SIEMPRE VIVA 123".
        PROCEDURE DIVISION.
        00001-PRIMER-SECCION SECTION.
        00001-MIPARRAFO.
            DISPLAY "BIENVENIDO AL PROGRAMA".
            DISPLAY "PROGRAMA DE VARIABLES"
            ACCEPT WKS-NOMBRE.
            DISPLAY "HOLA,"       WKS-NOMBRE.
            DISPLAY "REGISTRO EMPLEADO: " WKS-REGISTRO-EMPLEADO.
            DISPLAY "EDAD: "      WKS-EDAD.
    *** change WKS-NOM-TRAB to WKS-NOMBRE-TRAB
            DISPLAY "NOMBRE: "    WKS-NOMBRE-TRAB.
            DISPLAY "APELLIDOS: " WKS-APELLIDOS-TRAB.
            DISPLAY "DIRECCION: " WKS-DIRECCION.
    *** change WKS-GASTOS to GASTOS
            DISPLAY "GASTOS: "    GASTOS.
            DISPLAY "BANDERA: "   WKS-BANDERA.
            STOP "PAUSA".
            STOP RUN.

I created a source member from your code named TEST0017CB. Srctype CBLLE.

Compiled the code using option 14 in PDM. CRTBNDCBL

CRTBNDCBL ??PGM(WLKLIB/TEST0017CB)
          ?*SRCFILE(steve/QRPGLESRC)
          ?*SRCMBR(TEST0017CB)
          ??REPLACE(*YES)

The compile failed. Ran WRKJOB command. Option 4. spooled files. The compile output listing is the last spooled file in the list. Use option 5 to display the compile listing.

got these compile errors

    STMT
 *     2  MSGID: LNC0810  SEVERITY: 10  SEQNBR:  000200
          Message . . . . :   Module name 'TEST0017CB' does not match outermost
            PROGRAM-ID name 'USOVAR'. Accepted.
 *    30  MSGID: LNC1326  SEVERITY: 30  SEQNBR:  003900
          Message . . . . :   'WKS-NOM-TRAB' not defined name. Statement or
            clause ignored.
 *    33  MSGID: LNC1326  SEVERITY: 30  SEQNBR:  004200
          Message . . . . :   'WKS-GASTOS' not defined name. Statement or clause

corrected the source code:

        IDENTIFICATION DIVISION.
        PROGRAM-ID.    TEST0017CB.
        AUTHOR.        REINALDO ENRIQUE URQUIJO YANIEZ.
        DATE-WRITTEN.  24/03/2022.
        ENVIRONMENT DIVISION.
        DATA DIVISION.
        WORKING-STORAGE SECTION.
        77 WKS-NOMBRE                 PIC A(30).
        01 WKS-REGISTRO-EMPLEADO.
           02 WKS-NOM-EMP.
             03 WKS-NOMBRE-TRAB      PIC A(20)
                                        VALUE "PEDRO".
             03 WKS-APELLIDO-PATERNO PIC A(20)
                                        VALUE "PEREZ".
              03 WKS-APELLIDO-MATERNO PIC A(20)
                                        VALUE "ROJAS".
           02 WKS-EDAD                PIC 9(02)
                                        VALUE 48.
           02 WKS-SALARIO             PIC 9(05)V99
                                        VALUE 788.22.
        66 WKS-APELLIDOS-TRAB RENAMES
              WKS-APELLIDO-PATERNO THRU WKS-APELLIDO-MATERNO.
        01 WKS-BANDERA PIC 9(01).
           88 WKS-TRUE  VALUE 1.
           88 WKS-FALSE VALUE 0.
        77 GASTOS                     PIC 9(05)V99.
        77 WS-HORAS                   PIC 9(10).
        01 WKS-DIRECCION              PIC X(30)
                                        VALUE "AV SIEMPRE VIVA 123".
        PROCEDURE DIVISION.
        00001-PRIMER-SECCION SECTION.
        00001-MIPARRAFO.
            DISPLAY "BIENVENIDO AL PROGRAMA".
            DISPLAY "PROGRAMA DE VARIABLES"
            ACCEPT WKS-NOMBRE.
            DISPLAY "HOLA,"       WKS-NOMBRE.
            DISPLAY "REGISTRO EMPLEADO: " WKS-REGISTRO-EMPLEADO.
            DISPLAY "EDAD: "      WKS-EDAD.
    *** change WKS-NOM-TRAB to WKS-NOMBRE-TRAB
            DISPLAY "NOMBRE: "    WKS-NOMBRE-TRAB.
            DISPLAY "APELLIDOS: " WKS-APELLIDOS-TRAB.
            DISPLAY "DIRECCION: " WKS-DIRECCION.
    *** change WKS-GASTOS to GASTOS
            DISPLAY "GASTOS: "    GASTOS.
            DISPLAY "BANDERA: "   WKS-BANDERA.
            STOP "PAUSA".
            STOP RUN.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文