Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PRO COBOL WITH VARCHAR FIELD TYPE
Lou de Freitas wrote:
>
> 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?
You are correct, with one caveat. My experience with Oracle has shown that fetches into the COBOL -ARR variable will only fill the number of positions specified in the -LEN variable and leave the rest as is.
More specifically, if the first value fetched is "HELLO WORLD", AJL-BFR-IMAGE-ARR will contain "HELLO WORLD" followed by whatever the field was originally initialized to. If the second value fetched is "GOODBYE", AJL-BFR-IMAGE-ARR will contain "GOODBYEORLD" followed by whatever the field was originally initialized to. In this case, assuming AJL-BFR-IMAGE-ARR was initialized to SPACES, the output of your example code would be:
BEFORE LEN IS 11
BEFORE DATA HELLO WORLD
BEFORE LEN IS 7
BEFORE DATA GOODBYEORLD
The point to all this is that to get only the fetched value and nothing
else, your last line of example code should read:
DISPLAY 'BEFORE DATA ' AJL-BFR-IMAGE-ARR(1:WS-DISP-CNT). Hope that helps! Received on Fri Aug 20 1999 - 11:44:02 CDT
![]() |
![]() |