How to create an AS / 400 team with mutually exclusive parameters?

I need to create an AS / 400 team. Based on this requirement, it has two parameters, for example A and B, which cannot be filled at the same time. Both will be displayed when F4 is pressed to call, but only one can be filled at a time. If both of them are filled in, an error message should appear indicating that this is incorrect. Can someone tell me how to create such a team? What do I need to specify in the CMD source to achieve it?

+4
source share
2 answers

Use the DEP command description to control the parameters.

CMD PROMPT('TEST') PARM KWD(A) TYPE(*CHAR) PROMPT('A') PARM KWD(B) TYPE(*CHAR) PROMPT('B') DEP CTL(*ALWAYS) PARM(AB) NBRTRUE(*EQ 1) 
+8
source

A CMD source has only a rudimentary ability to perform validation. Typically, end-user business rules are applied by a validation program. See CRTCMD VLDCKR (). VCP is very similar to CPP, unless the command performs validation, your VCP sends the * DIAG message with detailed reason information to the caller, and CPF0002 * ESCAPE to the caller to tell him that the command is not working.

0
source

Source: https://habr.com/ru/post/1379466/


All Articles