Error received on CPYFRMIMPF command – SQL0842

115 pts.
Tags:
CL
CPYFRMIMPF
Error SQL0842
Does anyone know what command should be run prior to the CPYFRMIMPF command to close what needs closed. Running this in a CL program.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

Have you tried RCLRSC?

Regards,

Martin Gilbert.

*************************
I looked up that message ID and read its message text.
<b>
Message . . . . : Connection to relational database &1 already exists.
Cause . . . . . : An attempt was made to do one of the following:
— CONNECT to a relational database when the connection is active.
— CONNECT to a relational database that has the same communication
information as a connection to a relational database that is active.
The active relational database is &1.
Recovery . . . : If CONNECT was specified, either use the SET CONNECTION
statement to make relational database &1 the current connection or change
the RDB directory entry (CHGRDBDIRE) for the relational database you are
connecting to so that at least part of the communication information is
different from what is specified in the entry for &1. For APPC connections,
the communication information is the remote location, device description,
local location, remote network identifier, mode, and transaction program.
For TCP/IP connections, the communication information is the remote location
and port identification.
</b>
This suggests that there’s another active SQL connection to the database. Because CPYFRMIMPF uses SQL behind the scenes, I can see why it would need an SQL connection, but in my experience, the operating system manages this automatically. Are you connecting to the system from an outside source, such as running the CL from a client application via a RMTCMD or something?

CWC

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following