Problem solve Get help with specific problems with your technologies, process and projects.

Command special values: One set for the user, one set for the program

Different sets of values for user-defined commands and programs helps users select reports.

John Kohan

Did you know you can have the user select one set of values on user-defined commands, yet have your program receive...

a totally different set of values? This is helpful when you need to interrupt what the user selected into "Program Logic". Below is an example that asks the user what type of report they want.

CMD        PROMPT('Activity Reports')

             DFT(*ACTIVITY) VALUES(1 2 3) +  

             SPCVAL((*ACTIVITY 1) (*MOVEMENT 2) +        
             (*ADJUSTMENT 3)) 

             MIN(0) PROMPT('Type of  Report')                                

When the user enters *MOVEMENT, the called program will receive a "2". Now a simple select statement will produce the requested report. This is much easier for the user to understand which report they are selecting.

About the author: John Kohan is a senior programmer analyst at CT Codeworks.


  • Accessing any job's QTEMP
    Finally there is a way to run commands on any job, batch or online and without any cumbersome pre-requisites.
  • Editing a source member without SEU
    You can editing a source member without SEU if your iSeries 400 is on V4R4 or later by using the EDTF command. This command is typically used for editing files in the iSeries integrated file system, but you can also use it to edit a source member.
  • All 256 possible values of a character
    Here's an RPG program to list all 256 possible values of a character along with binary representation.

This was last published in April 2002

Dig Deeper on iSeries CL programming

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.