Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-01036 and Pro*COBOL
John Croucher wrote:
> Platform: IBM/390 2.7 (MVS)
> COBOL 370
> Oracle 8.0.4.4.0
> Pro*Cobol Release 1.8.26.0.0
> Precompiler parms:
> LNA=/DD/SYSOUT
> ONA=/DD/SYSPUNCH
> INA=/DD/SYSIN
> ASACC=YES
> MODE=ANSI
> DEFINE=CICS
> LITDELIM=APOST
> SQLCHECK=SEMANTICS
> Error code: 00000103O
> Error message: ORA-01036: illegal variable name/number
>
>
> Hi Group,
> I am trying a execute a COBOL program with embedded SQL. Please note
> that I can get the program and all of its sub-programs to compile
> cleanly. However, when I execute the program, I receive error messages
> of ORA-01036. I have determined that the errors are generated when the
> following statments is executed:
> exec sql
> select count(*)
> into :query-size
> from dprog
> where dprog = :ws-dprog and
> instidq = :ws-instidq and
> instid = :ws-instid and
> instcd = :ws-instcd and
> lyt >= :ws-catlyt and
> dpfyt <= :ws-catlyt
> end-exec.
>
> exec sql
> select instcd, dprog, lyt, dpfyt, dptitle1, dptitle2,
> dpcips, dpmask, dpstatus
> into :dpq-instcd, :dpq-dprog, :dpq-lyt, :dpq-fyt,
> :dpq-dptitle-1 :indic-var,
> :dpq-dptitle-2 :indic-var,
> :dpq-cips :indic-var,
> :dpq-dpmask :indic-var,
> :dpq-status :indic-var
> from dprog
> where dprog = :ws-dprog and
> instidq = :ws-instidq and
> instid = :ws-instid and
> instcd = :ws-instcd and
> lyt >= :ws-catlyt and
> dpfyt <= :ws-catlyt
> end-exec.
>
> I don't know how much help it will be, but I have pasted a copy of the
> program below. Also, when the program executes, the count returns
> zero. Any help you can provide on this would be greatly appericiated.
> Thank you,
> John C.
> Athens, OH
>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++> **
>
> *
> WORKING-STORAGE SECTION.
>
> ******************************************************************
> **
> **
> ** local variables
> **
> **
> **
> ******************************************************************
> exec sql include sqlca end-exec.
> * exec sql include conparms end-exec.
> exec sql include degsqldd end-exec.
>
> exec sql begin declare section end-exec.
>
> 01 i pic s9(4) comp value +0.
> 01 ws-instidq pic x(2) value spaces.
> 01 ws-instid pic x(8) value spaces.
>
> 01 ws-dpkey.
> 05 ws-instcd pic x(3) value spaces.
> 05 ws-dprog pic x(15) value spaces.
> 05 ws-catlyt pic x(6) value spaces.
>
> ** 2/22/01 added field to capture size for count
> 01 query-size pic S9(4) comp value 0.
>
> **** the junk-data values hold data not required by dars
> **** but required by informix so an order by clause can be used
> 01 junk-data.
> 05 junk-idq pic x(2) value spaces.
> 05 junk-id pic x(8) value spaces.
> 05 junk-cd pic x(3) value spaces.
> 05 junk-dprog pic x(15) value spaces.
> 05 junk-fyt pic x(6) value spaces.
> 05 junk-seq-no pic s9(9) comp value 0.
>
> 01 indic-var pic s9(4) comp value 0.
> **** The previous variable is used as an indicator variable in
> select
> **** statements for null column processing.
> 01 hold-element.
> 05 hold-rname pic x(9) value spaces.
> 05 hold-grp1 pic x value spaces.
> 05 hold-grp2 pic x value spaces.
> 05 hold-orflg pic x value spaces.
> 05 hold-optflg pic x value spaces.
> 05 hold-sumgrp pic x value spaces.
> 05 hold-crlink pic x value spaces.
> 05 hold-altcflg pic x value spaces.
> 05 hold-sortflg pic x value spaces.
> 05 hold-extend pic x value spaces.
> 05 hold-calcgrp pic x value spaces.
> 05 hold-calcflg pic x value spaces.
>
> exec sql end declare section end-exec.
>
> LINKAGE SECTION.
>
> copy "comstrls".
>
> copy "deguwmdd".
>
> copy "dumvardd".
>
> ******************************************************************
>
> PROCEDURE DIVISION USING COM-TABLE
> DP
> CLIENT-DEFINED-FIELD-1
> CLIENT-DEFINED-FIELD-2
> CLIENT-DEFINED-FIELD-3
> CLIENT-DEFINED-FIELD-4
> CLIENT-DEFINED-FIELD-5.
>
> ******************************************************************
> **
> **
> ** readdp-routine:
> **
> **
> **
> **
> **
> READDP-ROUTINE.
> **
> **
> move "READDP" to err-module.
>
> exec sql include sqlinit end-exec.
>
> if COM-TEST = "X"
> display "READDP: Attempting to find: " COM-DPKEY
> display function current-date
> end-if.
>
> move spaces to DP-SQL.
> move 0 to i
> DPQ-SEGCT.
> move -1 to COM-DARETCD.
>
> perform read-dprog thru read-dprog-exit.
>
> move 1 to COM-DARETCD.
> move DP-SQL to DP.
> compute DP-SEGCT = DPQ-SEGCT.
>
> if COM-TEST = "X"
> display "SELECTDP EXIT " COM-DARETCD " DPKEY: " DPQ-KEY
> " FYT: " DPQ-FYT
> display function current-date
> end-if.
>
> jmc GOBACK.
>
> ******************************************************************
> /*****************************************************************
> **
> **
> **
> **
> **
Maybe you must check to area for the sql code. I think it must start from postion 12 and above.
-- Regards, Johan den Boer email : jj.den.boer_at_hccnet.nlReceived on Fri Jul 20 2001 - 23:54:48 CDT
![]() |
![]() |