Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I need to create an AS/400 command. Based on the requirement, it has two parameter, say A and B, which cannot be filled in the same time. Both will be displayed when F4 is pressed to prompt, but only one can be filled at a time. If both are filled an error message should appear saying this is invalid. Can someone tell me how to create a command like this? What do I need to specify in the CMD source to achieve it?

like image 370
God_of_Thunder Avatar asked Feb 22 '23 12:02

God_of_Thunder


1 Answers

Use the DEP command definition statement 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(A B) NBRTRUE(*EQ 1)
like image 106
James Allman Avatar answered Apr 27 '23 09:04

James Allman