Skip to main content

Hello everyone. We had to move our network drive from Win server 2003 onto Windows 2008 recently and during that move, the user that are on windows 7 are now getting a Runtime error 09/013 when trying to print. Before the move, they were able to print without any problem to a network printer or a local printer (LPT1)

However I have a few workstation that are still on Windows XP and they are able to print just fine. 

The cobol program was all done in Netexpress 4.0 

First I would like to mention that I am not a expert cobol programmer however can compile and resolve issue within cobol. At any rate, I am curious why moving data from Windows Server 2003 to Windows 2008 would cause this kind of issue?

I have read this thread in regard to this error 

/cobol/enterprisec/enterpriseserver/w/wikiid-118/34930/runtime-error-9-013-when-attempting-to-print-to-lptn-where-the-physical-printer-port-is-mapped-via-a-net-use-statement-on-windows-7

however if the user were able to print before on Windows 7 and now they can't...I'm just a bit puzzle. 

Any help or advise would be greatly appreciated. Thank you.

Hello everyone. We had to move our network drive from Win server 2003 onto Windows 2008 recently and during that move, the user that are on windows 7 are now getting a Runtime error 09/013 when trying to print. Before the move, they were able to print without any problem to a network printer or a local printer (LPT1)

However I have a few workstation that are still on Windows XP and they are able to print just fine. 

The cobol program was all done in Netexpress 4.0 

First I would like to mention that I am not a expert cobol programmer however can compile and resolve issue within cobol. At any rate, I am curious why moving data from Windows Server 2003 to Windows 2008 would cause this kind of issue?

I have read this thread in regard to this error 

/cobol/enterprisec/enterpriseserver/w/wikiid-118/34930/runtime-error-9-013-when-attempting-to-print-to-lptn-where-the-physical-printer-port-is-mapped-via-a-net-use-statement-on-windows-7

however if the user were able to print before on Windows 7 and now they can't...I'm just a bit puzzle. 

Any help or advise would be greatly appreciated. Thank you.

The article states that the problem was fixed in NX 5.1 WS6 and you are using NX 4.0 which has not been supported for a very long time. Is it not possible for you to upgrade to NX 5.1?

I understand that the printing worked before you switched out servers.

Does the copy command test still work on the Windows 7 machines? eg copy abc.txt LPT1

How are you printing in your programs?

Are you assigning a printer to LPT1: directly or are you assigning to PRINTER and then using the printer_redirection tunable in a cobconfig file?

 


The article states that the problem was fixed in NX 5.1 WS6 and you are using NX 4.0 which has not been supported for a very long time. Is it not possible for you to upgrade to NX 5.1?

I understand that the printing worked before you switched out servers.

Does the copy command test still work on the Windows 7 machines? eg copy abc.txt LPT1

How are you printing in your programs?

Are you assigning a printer to LPT1: directly or are you assigning to PRINTER and then using the printer_redirection tunable in a cobconfig file?

 

Thank you Chris for responding. 

When I do a copy abc.txt LPT1 it does print.

Printing from a Spooler file (spooldtl.dat) that is stored on the server 

SELECT SPOLDETL ASSIGN TO DISK
"N:\\SPOOLER\\SPOOLDTL.DAT"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
LOCK MODE IS MANUAL
STATUS IS WS-STATUS
RECORD KEY IS SPDETL-KEY.

SELECT PRINT-OUT ASSIGN TO PRINTER.

 

We would love to upgrade to NX5.1 however we are not on maintenance. We had one licence on a workstation running NX4.0 that I was able to use to compile and fix program however that workstation crashed recently. Hard drive failure. When trying to re-install it on a new machine, I would need a Response key. I'm not sure who to talk to get that since we had NX 4.0 since 2005 and I'm sure the rep that we purchased the Micro Focus NX 4.0 is no longer there.

The only other option is to migrate to Visual Micro Focus? I was inherited this cobol programming task when I first started and to be honest, I understand the coding however I'm far from being an expert.   

Thanks for any help in this matter.

 

 

 


Thank you Chris for responding. 

When I do a copy abc.txt LPT1 it does print.

Printing from a Spooler file (spooldtl.dat) that is stored on the server 

SELECT SPOLDETL ASSIGN TO DISK
"N:\\SPOOLER\\SPOOLDTL.DAT"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
LOCK MODE IS MANUAL
STATUS IS WS-STATUS
RECORD KEY IS SPDETL-KEY.

SELECT PRINT-OUT ASSIGN TO PRINTER.

 

We would love to upgrade to NX5.1 however we are not on maintenance. We had one licence on a workstation running NX4.0 that I was able to use to compile and fix program however that workstation crashed recently. Hard drive failure. When trying to re-install it on a new machine, I would need a Response key. I'm not sure who to talk to get that since we had NX 4.0 since 2005 and I'm sure the rep that we purchased the Micro Focus NX 4.0 is no longer there.

The only other option is to migrate to Visual Micro Focus? I was inherited this cobol programming task when I first started and to be honest, I understand the coding however I'm far from being an expert.   

Thanks for any help in this matter.

 

 

 

good morning and hope all is well. 

"Are you assigning a printer to LPT1: directly or are you assigning to PRINTER and then using the printer_redirection tunable in a cobconfig file?"

When I do a search for a cobconfig file on the server, I can't find one. But the program does appear that I am assigning to PRINTER. After going through the source code of the printing program, I don't see any printer_redirection.

After doing additional testing, it appear I am able to print to LPT1 if a local printer is installed. However get the error when trying to use the "net use" command to map a network printer.

I'm curious if the program uses a temporary folder or file before it send it to the printer? Could it be a permission issue? 

I tried adding a local printer by creating a network port on the same workstation to the printer. Then sharing the printer on the same workstation to perhaps rule out a permission issue however still have the same error. 

 

 

 

 


good morning and hope all is well. 

"Are you assigning a printer to LPT1: directly or are you assigning to PRINTER and then using the printer_redirection tunable in a cobconfig file?"

When I do a search for a cobconfig file on the server, I can't find one. But the program does appear that I am assigning to PRINTER. After going through the source code of the printing program, I don't see any printer_redirection.

After doing additional testing, it appear I am able to print to LPT1 if a local printer is installed. However get the error when trying to use the "net use" command to map a network printer.

I'm curious if the program uses a temporary folder or file before it send it to the printer? Could it be a permission issue? 

I tried adding a local printer by creating a network port on the same workstation to the printer. Then sharing the printer on the same workstation to perhaps rule out a permission issue however still have the same error. 

 

 

 

 

If you are assigning to PRINTER in your program than you will need to setup the printer_redirection tunable in order to print to a network printer instead of the local printer LPT1.

Create a file called cobconfig.cfg and place in it the following line:

set printer_redirection=TRUE

Then set the environment variable called COBCONFIG_ to point to that file-name.

Example:

SET COBCONFIG_=c:\\myapp\\cobconfig.cfg

Then when you open the printer in your program it will be assigned to whatever the default network printer is set to on your system.

 


If you are assigning to PRINTER in your program than you will need to setup the printer_redirection tunable in order to print to a network printer instead of the local printer LPT1.

Create a file called cobconfig.cfg and place in it the following line:

set printer_redirection=TRUE

Then set the environment variable called COBCONFIG_ to point to that file-name.

Example:

SET COBCONFIG_=c:\\myapp\\cobconfig.cfg

Then when you open the printer in your program it will be assigned to whatever the default network printer is set to on your system.

 

Thank you Chris for the reply. 

What I am understanding is:

1. Create a file cobconfig.cfg (c:\\temp\\cobconfig.cfg) on the local machine. Inside that cfg file has the line set printer_redirection=TRUE

2. On the local computer, I go into the Environment Variable. Do I create the COBCONFIG_ in the user variable or the system variable? (I tried both and still get the same error)

Add new:

Variable name: COBCONFIG_

Variable value: SET COBCONFIG_=c:\\temp\\cobconfig.cfg 

 

Do I need to do anything to the source code? and re-compile it? I double check the workstation that was working before this happen and I don't see any cfg pointer in their environment variable. All of this is very puzzling to me when it worked before and now it doesn't with just moving data directory. I don't think its a permission issue.

Thank you again for all your assistance. On the side note, I was able to get Net Express 4.0 back working for now. I'll be contacting MF about migrating to Visual Cobol. Hope I can get this resolve before then. 


Thank you Chris for the reply. 

What I am understanding is:

1. Create a file cobconfig.cfg (c:\\temp\\cobconfig.cfg) on the local machine. Inside that cfg file has the line set printer_redirection=TRUE

2. On the local computer, I go into the Environment Variable. Do I create the COBCONFIG_ in the user variable or the system variable? (I tried both and still get the same error)

Add new:

Variable name: COBCONFIG_

Variable value: SET COBCONFIG_=c:\\temp\\cobconfig.cfg 

 

Do I need to do anything to the source code? and re-compile it? I double check the workstation that was working before this happen and I don't see any cfg pointer in their environment variable. All of this is very puzzling to me when it worked before and now it doesn't with just moving data directory. I don't think its a permission issue.

Thank you again for all your assistance. On the side note, I was able to get Net Express 4.0 back working for now. I'll be contacting MF about migrating to Visual Cobol. Hope I can get this resolve before then. 

You don't have to modify anything in your source code to use this method as you are already doing an ASSIGN to PRINTER.

Is the printer to which you are trying to print set as the default printer on the local system? The default printer is the one to which the output will be directed.

The environment variable should be set as a system environment variable: