Exercise 4.4: Running commands and programs

Before you begin, you must complete Exercise 4.3: Submitting iSeries commands in the iSeries table view.

As you know already, you can run programs and commands from the Remote Systems view or the iSeries Table view in three ways:

  1. In the Remote System Explorer communications server job.

    This is the one you are using currently.

  2. In a batch job.
  3. In an interactive job (to test 5250 applications).
  4. In a server job

Using the first option lets you run the program in the same job as the communications server. With batch and interactive jobs, you cannot monitor the status as easily, however, you do not tie up your communications server and you are notified when the program command ends. Batch jobs work as you would expect and do not require any initial setup. Interactive programs require a 5250 emulator, and you need to first run a STRRSESVR connectionName command to associate the emulator with a particular connection in the Remote System Explorer communications server. A multi-threaded debug session creates a new server job and this way keeps the RSE communications server job free for other tasks.

Starting an interactive connection

To start an interactive connection:

  1. Start a 5250-emulation session.
  2. Sign-on to the iSeries with your User ID and password.
    Note:
    Instead of the Enter key, you may have to use the Ctrl key in your 5250-emulation session.

    Start Remote System Explorer interactive connection
  3. In the command line, type the command
    STRRSESVR connectionName 
    
  4. Press Enter.

    The connectionName parameter is the name of your connection defined in the Remote Systems view. This associates the interactive job with the Remote System Explorer communications server.

Running the payroll program

Now you are ready to run the program that you just compiled.

Return to the workbench.

To run the program:
Run RPG program interactive

  1. In the Remote Systems view, locate the PAYROLL program that you created.
  2. Right-click the PAYROLL program.
  3. Click Run As > Interactive on the pop-up menu.
  4. Switch to your 5250-emulation session.

    You will see the payroll program menu.
    Payroll Start Menu

  5. Type x beside Employee Master Maintenance.
  6. Press Enter.
  7. Type 234 for the Employee Number.
  8. Type A for the Action Code to add employee 234.
  9. Press Enter.
  10. Type any information you like about the employee.
  11. Press Enter.
  12. Play in the application as much as you like.
  13. Press F3 to end the applications.
  14. To get control of the interactive job, right-click iSeries Objects and click Release Interactive Job on the pop-up menu.

    You can also choose to disconnect a session. You would right-click the connection and click Disconnect on the pop-up menu.

Now you are ready to review your knowledge of this module by taking the quiz. You can also apply what you have learned in this module by completing the practice tasks detailed in More practice.

Quiz

  1. The ______ tool checks for semantic (compile) errors on your workstation so that you can guarantee a clean compile on the iSeries.
    1. Compile
    2. LPEX Editor
    3. Program Generator
    4. Program Verifier
  2. The ____________ view identifies each error with the severity level of the error, the ID of the error, the message, the severity, the line in the source member that caused the error, the location of the source member that produced the error, and the connection name.
    1. Remote Systems
    2. Outline
    3. Navigator
    4. iSeries Error List
  3. You can sort the entries in the iSeries Error List view by:
    1. ID
    2. Message
    3. Severity
    4. Line
    5. Location
    6. Connection
    7. All of the above
  4. If you used the local program verifier, then your host compiles should be successful; no wasted iSeries cycles. (T, F)
  5. A compile command can be run on an iSeries server from the Remote System Explorer, and you can retrieve error feedback from the compile. (T, F)
  6. From the iSeries Table view you can:
    1. List and sort libraries, objects, and members
    2. Copy, rename, delete, edit, compile and run (for programs), open with and browse (for members) in the view from the pop-up menu
    3. Transfer files from one system to another
    4. All of the above
  7. You can run programs and commands from the Remote Systems view or the iSeries Table view in:
    1. A Remote System Explorer communications server job
    2. A batch job
    3. An interactive job
    4. Multi-threaded
    5. All of the above
  8. Interactive programs require a 5250 emulator, and you need to first run a STRRSESVR connectionName command to associate the emulator with a particular connection in the Remote System Explorer. (T, F)

More practice

Given your experience using the Program Verifier and Compile command, and that you have your own source on your own iSeries system, try these new tasks: Check out Compile (Prompt) Work with Compile commands. Assuming you receive errors in your source (add some errors into your source if you don't have any) when you verify your source, choose insert all error messages into the editor from the Error list. Use the product online help to assist you in these tasks.

Module recap

You have completed Module 4. Verifying and compiling source. You have learned how to:

Now that you know how to verify and compile source from the Remote Systems view and run the payroll program interactively, you can move onto debugging your payroll program. Continue to Module 5. Debugging a program.