Arvind Badeti
Arvind Badeti

Reputation: 1

Condition based command parameters filling in prompt

I want to fill the parameters in conditional based in the command prompt in *CMD Creation in as400.

let say we have 3 parms (A B C)

PARM KWD(A) TYPE (*CHAR) VALUE(A1 A2) LEN(11) MIN(1)

PARM KWD(B) TYPE (*CHAR) VALUE(B1) LEN(11) MIN(1)

PARM KWD(C) TYPE (*CHAR) VALUE(C1) LEN(11) MIN(1)

Here I entered the first value is A1 in Parm A. Now I want to demonstrate only one field that is Field B.

So next if I entered the value of A2 in the field A.so now I want to demonstrate the field is C.so how can I create the logic with based on these conditions.

Upvotes: 0

Views: 627

Answers (2)

RockBoro
RockBoro

Reputation: 2483

use the PMTCTL command to define a condition. Then use the PMTCTL parameter on the PARM command to specify the condition under which the parameter is prompted.

             CMD        PROMPT('conditional paramters')

             PARM       KWD(A) TYPE(*CHAR) LEN(11) RSTD(*YES) +      
                          VALUES(A1 A2) PROMPT('parm a') 
             PARM       KWD(B) TYPE(*CHAR) LEN(11) RSTD(*YES) +      
                          VALUES(B1) PMTCTL(COND_A1) PROMPT('parm b')
             PARM       KWD(C) TYPE(*CHAR) LEN(11) RSTD(*YES) +      
                          VALUES(C1) PMTCTL(COND_A2) +               
                          PROMPT('parm c')
  COND_A1:   PMTCTL     CTL(A) COND((*EQ A1)) 
  COND_A2:   PMTCTL     CTL(A) COND((*EQ A2)) 

Upvotes: 2

iiSiggi
iiSiggi

Reputation: 175

Good morning, if I understand you right you want to fill parameters based on the input of another input field like in savobj below. SAVOBJ (german) To be honest I don't know how to acheive this with cmd but I also do not know if the way you described was the way of the IBM. I would rather guess that this is a common program which works with *noPass and *omit. If this is cool for you you can find further information here:

Upvotes: 0

Related Questions