Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> PRO COBOL WITH VARCHAR FIELD TYPE
I need to know the correct method to code a cobol program dealing with a
varchar field.
I think this is how it should be:
1). DDL field defined as VARCHAR:
AJL_BFR_IMAGE VARCHAR (2000), 2). DCLGEN field defined as follows: 03 AJL-BFR-IMAGE PIC X(2000) VARYING.3). Since field is nullable, then a null indicator field must be setup as follows:
05 IND-AJL-BFR-IMAGE-TEXT PIC S9(4) COMP VALUE +0. 4). HOST VARIABLES USED IN PROCEDURE DIVISION: :AJL-BFR-IMAGE:IND-AJL-BFR-IMAGE-TEXT 5).After the SELECT INTO OR FETCH the fields created by the PRO COBOL set
would be: * 03 AJL-BFR-IMAGE PIC X(2000) VARYING. 03 AJL-BFR-IMAGE. 04 AJL-BFR-IMAGE-LEN PIC S9(4) COMP. 04 AJL-BFR-IMAGE-ARR PIC X(2000). and you would never reference via cobol the base field AJL-BFR-IMAGE,instead
For example:
MOVE AJL-BFR-IMAGE-LEN TO WS-DISP-CNT. DISPLAY 'BEFORE LEN IS ' WS-DISP-CNT. DISPLAY 'BEFORE DATA ' AJL-BFR-IMAGE-ARR.AM I CORRECT? I AM USING MICROSFOCUS COBOL UNDER 95, NT and UNIX and I think this is correct? Received on Thu Aug 19 1999 - 15:36:17 CDT