There is a long list of possible reasons for MQRC_ENVIRONMENT_ERROR (2012) on this page in IBM Docs for MQ.
Reviewing that list knowing that you are using amqsputc - a C language program - and all we know about what it is coded to do; and that you are on Linux (a guess from the use of LD_LIBRARY_PATH, the /opt/mqm path and exporting your environment variables); and that you are making a client connection, then I think the following possibilities from the list on that page are the most likely:
- The application is linked to unsupported libraries.
- The application is linked to the wrong libraries (threaded or nonthreaded)
- An MQ client application that has been configured to use automatic reconnection attempted to connect using a channel defined with SHARECNV(0).
Hope that helps. Please come back with more details and we can help you further.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website:
https://www.mqgem.com------------------------------
Original Message:
Sent: Wed May 22, 2024 04:39 AM
From: トシミ クロサワ
Subject: resaon Code 2012
An error of easonCode2012 is occurring.What is the cause of this error?Connect using server connection channel with IBM MQ with below settings*Local connection from MQ server using server connection channel・export LD_LIBARY_PATH=/opt/mqm/mqcl/lib64→ Store MQ client library separately (amqscputc uses C language dynamic library)・Local connection from MQ server using server connection channel・Export MQSEREVR =QEACLINT1/tcp/localhost(1414)*CHLAUTH is QMGR and set to DISABLED, so there are no channel access restrictions../amqscputc QUE QMGRMQCCONX ended With 2012Added: I had similar results with the default server connection channel (SYSTEM.DEF.SVRCONN).
------------------------------
トシミ クロサワ
------------------------------