Re: ESQL/COBOL
Posted in 1997
[This followup was posted to comp.databases.informix and a copy was sent
to the cited author.]
In article <64a3hb$fld@news.onramp.net>, bobbyt@onramp.net says...
> We are experiencing pre-compile errors with the ESQL/COBOL product.
> Apparently, the pre-compiler does not recognize group level working storage
> items which are referenced in a SQL statement. For example:
>
> 01 PHONE-NUMBER.
> 05 AREA-CODE PIC X(03).
> 05 PREFIX PIC X(03).
> 05 SUFFIX PIC X(04).
>
> SELECT * FROM customer
> INTO :WS-CUST, :WS-PHONE
> WHERE phone_number=:PHONE-NUMBER;>
> In the above example, :PHONE-NUMBER would not be recognized and result in an
> error. This syntax is ANSI standard and fully supported in Micro Focus COBOL.
> Any help would be appreciated. TIA.
>
> Bobby Taylor
> bobby_taylor@pagenet.com
>
>
You will have to do something like
01 Phone-Number-Data PIC X(10).
01 Phone-Number REDEFINES
Phone-Number-Data.
05 Area-Code PIC XXX.
05 Prefix PIC XXX.
05 Suffix PIC X(4).
SELECT *
FROM Customer
INTO :WS-Cust, :WS-Phone
WHERE Phone_Number=:Phone-Number;
May I also suggest not doing an "SELECT *" it may save you latter if a
column needs to be added to the table but not needed for this purpose.
Michael J. Erickson
You can reply to me by removing .nospam from my address