Community in read only mode June 18 & 19
This community will be set in READ ONLY mode for a while on Tuesday June 18 into Wednesday June 19 while we import content and users from our Micro Focus Forums community site. MORE INFORMATION
Georg3 Absent Member.
Absent Member.
4999 views

Visual Cobol - File Status 9/181

Jump to solution

[Migrated content. Thread originally posted on 12 September 2011]

Hi,
I have installed the trial version R4 to test the upgrade from NetExpress to Visual Cobol.

When the program is startet via .bat-job, produces each open-command a file status 9/181 (open input and open output).

Has anyone an idea?

Georg
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Visual Cobol - File Status 9/181

Jump to solution
I have found the problem and I believe that I have a solution for you.

In Visual COBOL we changed the default values for the following two file handler configuration options so that 64-bit file handling would be supported by default.

In Net Express the default was to use 32-bit file handling.

IDXFORMAT= NX=4 - VC=8
FILEMAXSIZE= NX=4 - VC=8

So in Visual COBOL when a file is opened, a 64-bit flag is being passed to the CBL_OPEN_FILE run-time routine whereas in Net Express a 32-bit flag is passed.

Novell Netware drives behave like 32-bit drives and can therefore only handle files up to 4GB in size.

So when Visual COBOL attempts to open a file using 64-bit flags on a Novell Netware drive the operation fails with a file status 9/181 which means invalid parameter. (the 64-bit flag)

So in order to access files on a Novell Netware drive in Visual COBOL you will need to set the following two options in the file handler configuration file.

[XFH-DEFAULT]
IDXFORMAT=4
FILEMAXSIZE=4

Please let me know if this solves the issue for you.

Thanks.



10 Replies
Micro Focus Expert
Micro Focus Expert

RE: Visual Cobol - File Status 9/181

Jump to solution
We will need some more detailed information.

Did you recompile the Net Express program for native code or for .NET managed code?
What is the program actually doing when it is being started from the .bat file.
You state that the error occurs when running from a batch job, does this mean that it runs correctly from within the IDE?

What operation is actually being performed that returns a status 9/181?
Are your files locatable by the program?

Thanks.
0 Likes
Georg3 Absent Member.
Absent Member.

RE: Visual Cobol - File Status 9/181

Jump to solution
Hi Chris,

thanks for your answer!

I compiled the program for native code and console application.

The job is running in a DOS-window.

All files are defined by "assign to external". The file-status "9/181" is returned form each OPEN (in- and output). For output-files, the files are created by the program (or DOS?) in the folder, but a later WRITE in a file return file-status "48".

I never run the job from the IDE, because I am not "fit" in this 😉

A further phenomenon is that the cblrtsm.dll must lie in the folder, where the "program.exe" is.
Perhaps there is another missing dll?

Georg
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Visual Cobol - File Status 9/181

Jump to solution
How are you compiling the programs if you are not using the Visual Studio 2010 IDE?
Are you using the command line along with the cobol or cbllink commands?

If the files are assign to external then how are you setting the environment variables before you run?
The errors that you are receiving sem to indicate that the environment variables are not being set properly.

If cblrtsm.dll cannot be found unless it is in the current folder then your PATH must not be set to point to the Visual COBOL 2010\bin folder.

You should try running this in a Visual COBOL 32-bit command prompt so that it sets the PATH properly.
You can find this from the start menu-->All Programs-->Micro Focus Visual COBOL 2010-->Tools

All of this would be much easier if you were to use Visual Studio 2010 to create a new project containing your programs and then build and debug within the IDE itself.

Thanks.
0 Likes
Georg3 Absent Member.
Absent Member.

RE: Visual Cobol - File Status 9/181

Jump to solution
Chris Glazier originally wrote:
How are you compiling the programs if you are not using the Visual Studio 2010 IDE?
Are you using the command line along with the cobol or cbllink commands?


I compiled the program within the IDE in a new projekt. The job runs in a dos-box to simulate the further run-time environment.

If the files are assign to external then how are you setting the environment variables before you run?
The errors that you are receiving sem to indicate that the environment variables are not being set properly.


Please contact me via e-mail hans-georg.decker@kzvk.de Then I can send you the bat file, as attachments in the forum are not allowed.

If cblrtsm.dll cannot be found unless it is in the current folder then your PATH must not be set to point to the Visual COBOL 2010\bin folder.

You should try running this in a Visual COBOL 32-bit command prompt so that it sets the PATH properly.
You can find this from the start menu-->All Programs-->Micro Focus Visual COBOL 2010-->Tools


I have tried it within the Visual COBOL 32-bit - box and the cblrtsm.dll-problem is fixed. 🙂

All of this would be much easier if you were to use Visual Studio 2010 to create a new project containing your programs and then build and debug within the IDE itself.

Thanks.
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Visual Cobol - File Status 9/181

Jump to solution
I have sent to you a private e-mail asking you to send required materials so that I can reproduce the problem.

Thanks.
0 Likes
Georg3 Absent Member.
Absent Member.

RE: Visual Cobol - File Status 9/181

Jump to solution
I have send it!

Georg
0 Likes
Georg3 Absent Member.
Absent Member.

RE: Visual Cobol - File Status 9/181

Jump to solution
I have the drive for the files from the network drive G: changed to the local hard disk C:. Now it works fine!

Is there a runtime-problem Visual Cobol with Novell?

Georg
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Visual Cobol - File Status 9/181

Jump to solution
We are currently investigating this issue off-line and we will update the post when issue has been resolved.

Thanks.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Visual Cobol - File Status 9/181

Jump to solution
I have found the problem and I believe that I have a solution for you.

In Visual COBOL we changed the default values for the following two file handler configuration options so that 64-bit file handling would be supported by default.

In Net Express the default was to use 32-bit file handling.

IDXFORMAT= NX=4 - VC=8
FILEMAXSIZE= NX=4 - VC=8

So in Visual COBOL when a file is opened, a 64-bit flag is being passed to the CBL_OPEN_FILE run-time routine whereas in Net Express a 32-bit flag is passed.

Novell Netware drives behave like 32-bit drives and can therefore only handle files up to 4GB in size.

So when Visual COBOL attempts to open a file using 64-bit flags on a Novell Netware drive the operation fails with a file status 9/181 which means invalid parameter. (the 64-bit flag)

So in order to access files on a Novell Netware drive in Visual COBOL you will need to set the following two options in the file handler configuration file.

[XFH-DEFAULT]
IDXFORMAT=4
FILEMAXSIZE=4

Please let me know if this solves the issue for you.

Thanks.



Georg3 Absent Member.
Absent Member.

RE: Visual Cobol - File Status 9/181

Jump to solution
Now it works very fine!

Thanks!
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.