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------------------------------