COBOL

COBOL

COBOL

COBOL is responsible for the efficient, reliable, secure, and unseen day-to-day operations of the world's economy.

 View Only
  • 1.  PCS-S-00400 error with exec sql

    Posted Mon November 30, 2015 07:06 AM

    Hello

    I am doing a compile on a cobol program, I want to use the below query, which works fine in oracle sql developer. I want to use it as a cursor is my cobol program.

    EXEC SQL DECLARE UTRSRAT_CURSOR CURSOR FOR                SELECT  to_char(UTRSRAT_EFFECT_DATE,'DD-MON-YYYY'),                        to_char(UTRSRAT_NCHG_DATE,'DD-MON-YYYY'),                        UTRSRAT_FLAT_CONSUMP,                        ROWID                        ,UTRSRAT_PRO_BASE_DAYS                        ,UTRSRAT_PRO_MIN_DAYS                        ,UTRSRAT_PRO_MAX_DAYS                FROM    UTRSRAT                WHERE   UTRSRAT_SRAT_CODE = :SRAT-CODE                  AND   UTRSRAT_SCAT_CODE = :SCAT-CODE                  AND   UTRSRAT_TEMP_RATE_IND = :TEMP-RATE-IND                  AND   UTRSRAT_EFFECT_DATE <=DECODE(utrsrat_tax_ind ,'T',TO_DATE(:charge-date,'DD-MON-YYYY'),TO_DATE(:CURRENT-READ-DATE,'DD-MON-YYYY'))                        AND   UTRSRAT_NCHG_DATE   >                            (TO_DATE(:charge-date,'DD-MON-YYYY')                                       - (:MP-HOLD-DOS + :MP-READ-DOS))                ORDER BY UTRSRAT_EFFECT_DATE           END-EXEC.

     

    However, I am getting the error below when doing the compile.. Can you please advise at to whats the cause of this issue?

     

    Error at line 10865, column 19 in file UBPCALC.pco
                      AND   UTRSRAT_NCHG_DATE   >
    ..................1
    PCB-S-00400, Encountered the symbol "AND" when expecting one of the following:

       + - * / . , ) : INDICATOR AT DAY YEAR ||

    PCB-I-0556:  Unrecoverable error.  Fix previous errors and re-precompile

    metal_navin


  • 2.  Re: PCS-S-00400 error with exec sql

    Posted Mon November 30, 2015 09:41 AM

    That's a Pro*COBOL message. This is a site for IBM COBOL.

    Your line 13 (it would be that one) is enormously long. Traditionally COBOL has 80 characters available per line, and not all of those are available for code.

    If your Pro*COBOL doesn't support "free format" COBOL, then spread that one line over several.

    If your Pro*COBOL does support "free format" COBOL, then spread that one line over several anyway and consider whether you want to use "free format".

    Did hovering over the little red x tell you anything?

     

    If this doesn't help anyway, locate a place to ask Pro*COBOL questions.

    I'd also smarten up the code and ensure things are all separated by space.


     

    BillWoodger


  • 3.  Re: PCS-S-00400 error with exec sql

    Posted Tue December 01, 2015 06:27 AM

    Sorry about that Bill,

    I solved my issue by opening the same code in another text editor, and making sure all the SQL is lined up properly...

    thank you

    metal_navin


  • 4.  Re: PCS-S-00400 error with exec sql

    Posted Sat May 14, 2016 08:48 PM

    Yo juraría que tengo un error muy parecido, sino es el mismo, tendré que mirar un poco más a fondo.

     

    Componentes Accesorios Bicicletas

    BicicletasCosme