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