Vice Admiral
Vice Admiral
487 views

Library Routines - File and Filename Routines - Interpreting the return code as a file status code

Micro Focus Developer > Micro Focus Visual COBOL 3.0 for Visual Studio 2013 > General Reference > Library Routines > File and Filename Routines

In the doc, under the sub-heading "Interpreting the return code as a file status code",

... it has an pseudo-example, thus:

 

 01 file-status      pic xx comp-x. 
 01 redefines file-status. 
     03 fs-byte-1  pic x. 
     03 fs-byte-2  cblt-x1-compx 
   . . . 
     call "CBL_xxx_xxx" using parameters 
     if return-code not = 0 
        move return-code to file-status 
           . . .

What does the cblt-x1-compx mean?  If it is shown incorrectly or incompletely, how should it be shown?

Thanks

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

That is a typedef definition that can be found in the file cbltypes.cpy.
It equates to:
01 cblt-x1-compx pic x comp-x typedef.

The example is incomplete in that in order to use the prototypes you need to add a copy statement for cbltypes.cpy at the top of your program.

The alternative is just to define a data-item as pic x comp-x.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.