When you have a problem, try to track all the outputs back to the inputs via the program.
From one of your other questions:
********************************************************
Credit card payment unit test tool
********************************************************
Incorrect usage!
Program Usage
-------------
PAYMENT <queue manager> <cics request queue> <reply queue> <userid> <payment value> <payment description>
The payment description has a maximum length of 35 characters.
The monetary value must be within the range 0.01 - 9999.99
The first two lines are easy to explain. The last two lines, not so. They are there to blinker us, as that exact text appears in the program. However, it seems that the exact same text is used in the displayUsage function.
It is bad to display identical text in different error circumstances. That's why we use message numbers - the message may then be the same, but the number will identify exactly where it has come from.
A clue is that you can't even get a very simple PARM to be accepted.
A further clue is that Incorrect usage!
.
When does that message get printed? When there are other than seven parameters. Err... but you only supply six.
So, if there are supposed to be six parameters, the program is wrong. If you should be supplying seven parameters, your PARM is wrong.
You can demonstrate this with
// PARM='A,B,C,D,1,F,G'
That will work.
As an aside, why was switch
used instead of a simple if
anyway? Using if
would have made the problem more obvious.