Step 2 Use the Command Assistant

Visual LANSA

Step 2. Use the Command Assistant

VED030 - Auto Complete and Command Assistant

In this step you will learn how to use the Command Assistant to create SELECT database command to retrieve all fields from the PSLMST file. The finished command will appear as follows:

Note: Experienced developers could quickly type this command into the editor, and the Autocomplete assistant would complete code and variables as they are typed (see later). The Command Assistant is intended to help new developers build this command.

1.  Insert a blank line after the BEGIN_LOOP command by positioning the cursor at the end of the line and pressing Enter.

2.  Press F4 to re-display the Command Assistant as a floating window. Note that it has the size and position which you gave it earlier.

3.  Select the Commands tab.

a.  Locate the SELECT command. (You can simply set focus on an item in the list of commands and type the letter S to position to commands starting with S.)

b.  Press Enter to select the SELECT command in the list of commands.

c.  The SELECT command is displayed in the Command Assistant.

4.  Use the down cursor key to move to the FROM_FILE parameter.

a.  Select the Files tab.

b.  Use the Tab key to move to the File name field. Type PS in the File name field to display files starting with PS.

c.  Select the PSLMST file and press Enter.

d.  The From_File parameter in the SELECT command will be updated.

5.  Click in the FIELDS parameter in the Assistant

     Click on the Fields by File tab and expand the file PSLMST to display all fields in the PSLMST file.

     You can now choose the fields that you want to include in the SELECT statement. For this example, simply select the EMPNO, ADDRESS1, ADDRESS2, ADDRESS3 and DEPTMENT fields. Use the Ctrl+left mouse button to select the fields required.

6.  Press Enter. The Fields parameter in the SELECT command will now be updated:

7.  Close the Command Assistant. Your code now looks like the following: