PRO COBOL WITH VARCHAR FIELD TYPE

From: Lou de Freitas <Luiz.deFreitas_at_dol.net>
Date: 1999/08/19
Message-ID: <37bc6b22.0_at_news.dol.net>#1/1


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
you would reference the two PRO COBOL generated fields: AJL-BFR-IMAGE-LEN and AJL-BFR-IMAGE-ARR.

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 - 00:00:00 CEST

Original text of this message