If we have very long commands, or are using a particular sequence of commands repeatedly, consider redirecting stdin from a batch file.
To redirect stdin from a batch file, first create a batch file containing the MQSC commands using your usual text editor. When we use the runmqsc command, use the redirection operators. The following example:
Creates a test queue manager, TESTQM
Creates a matching CLNTCONN and listener set to use TCP/IP port 1600
Creates a test queue, TESTQ
Puts a message on the queue, using the amqsputc sample program
Figure 1. Example script for running MQSC commands from a batch file