Highlighted
New Member.
593 views

Value of RETURN-CODE for CBL_CHECK_FILE_EXIST changed between NetExpress 5.1 and Visual Cobol 4.0

Jump to solution

Source:

       01  status-code              pic 9(04) comp.

           call "CBL_CHECK_FILE_EXIST" using file-name-1
                                             file-details
                                   returning status-code

 

Value if file is not found:

In NetExpress x"0d39" or 9/013.

Now in Visual Cobol x"11fd".

Is there any help or guidance - why this happens - and to deal with it?

I use also other "cbl_..._file" programs and I am migrating my application on Windows 7 x64. The application itself is 32bit.

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Value of RETURN-CODE for CBL_CHECK_FILE_EXIST changed between NetExpress 5.1 and Visual Cobol 4.0

Jump to solution

Hi Weinberger4,

I created a simple test program using Visual COBOL 4.0 and that returned x"390d" (a decimal value of 14605) for a non-existent file. I think that what you are seeing is as a result of you using a pic 9(4) comp field which has a valid range of 0 to 9999 ie four decimal digits and therefore if you display it or move it to another item its value is truncated from 14605 to 4605 (or x"11fd"). Were you perhaps using the NOTRUNC compiler directive in Net Express but not in Visual COBOL ?

As defined in the product documentation, the status-code should be a data item capable of holding a valid between 0 and 65535 eg pic 9(4) comp-5.

I hope that helps,

Gael

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Value of RETURN-CODE for CBL_CHECK_FILE_EXIST changed between NetExpress 5.1 and Visual Cobol 4.0

Jump to solution

Hi Weinberger4,

I created a simple test program using Visual COBOL 4.0 and that returned x"390d" (a decimal value of 14605) for a non-existent file. I think that what you are seeing is as a result of you using a pic 9(4) comp field which has a valid range of 0 to 9999 ie four decimal digits and therefore if you display it or move it to another item its value is truncated from 14605 to 4605 (or x"11fd"). Were you perhaps using the NOTRUNC compiler directive in Net Express but not in Visual COBOL ?

As defined in the product documentation, the status-code should be a data item capable of holding a valid between 0 and 65535 eg pic 9(4) comp-5.

I hope that helps,

Gael

View solution in original post

0 Likes
Highlighted
New Member.

RE: Value of RETURN-CODE for CBL_CHECK_FILE_EXIST changed between NetExpress 5.1 and Visual Cobol 4.0

Jump to solution
Hi Gael,

I have changed status-code to pic s9(09) comp-5,
as it is stated in cbltypes.cpy (from Micro Focus) for 32bit cbl-rtncode.

I didn't use the NOTRUNC compiler directive.

Thank you for your efforts.

Regards,
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.