Blog Archive

iSeries Conditional Command Parameter Example

iSeries(AS400) sample source code for command prompt using conditional parameters


             CMD        PROMPT('Conditional Command Parameters')         
             PARM       KWD(MYPARM) TYPE(*CHAR) LEN(20) MIN(1) +         
                          PROMPT('My first Parameter')                   
             PARM       KWD(OUTPUT) TYPE(*CHAR) LEN(8) RSTD(*YES) +      
                          DFT(*PRINT) VALUES(*OUTFILE *PRINT) +          
                          PROMPT('Output Type')                          
             PARM       KWD(OUTFILE) TYPE(*NAME) PMTCTL(OUTPMT) +        
                          PROMPT('Output File Name')                     
             PARM       KWD(REPLACE) TYPE(*CHAR) LEN(4) RSTD(*YES) +     
                          DFT(*YES) VALUES(*YES *NO) PMTCTL(OUTPMT) +    
                          PROMPT('Replace Output File')                  
OUTPMT:      PMTCTL     CTL(OUTPUT) COND((*EQ *OUTFILE))    

Parameters Output File name and Replace Output File will only show up when Output Type *OUTFILE is selected.