Creating Your First Hello PL/I World Application

Now that we've covered the basic features of the Eclipse IDE, and created a simple Hello World COBOL application, it is time for you to create the equivalent PL/I application:

Create a project

  1. Start Enterprise Developer.

    By default, when you start Eclipse, it displays a Workspace Launcher dialog box prompting you to specify a path for the Eclipse workspace. Specify a path and click OK.

    If this is the first time you start Eclipse, you now see the Eclipse Welcome page. See The Eclipse Welcome Page in this Introduction.

    Click Open PL/I Perspective as this perspective is the most suitable one for PL/I development.

  2. Select File > New > PL/I Project.
  3. Specify a name for your project such as HelloPLIWorld and click Finish.

    By default, the project will be created in the workspace that you selected when you started the Eclipse session.

Add a source file

You need to create a program in your project to hold the PL/I source code:

  1. Select your project in the PL/I Explorer view and click File > New > PL/I Source File.

    The New PL/I Source File wizard is displayed.

  2. In the New file name field type helloworld.pli.
  3. Click Finish.

    This adds a template PL/I file to your project and opens it in the editor.

  4. Copy and paste the following code into the editor, overwriting the existing text:
    HelloWorld: proc options (main);
      put skip list("Hello PL/I World!");
    end HelloWorld;
    
  5. Click File > Save.

    By default, Eclipse builds your project automatically. If you haven't configured Eclipse to do this, you can build a project at any time by clicking Project > Build Project.

    The progress of the project build is displayed in the Console view.

    When your project has been built, a folder called New_Configuration.bin is created in your project. Expand the folder in the PL/I Explorer view to see the executable and some .obj (Windows) or .o (UNIX) files.

You can now run the application.

Run Hello PL/I world

Applications you create in Eclipse need a launch configuration to execute. You are going to create a run configuration for the Hello PL/I world application as follows:

  1. Select your project in the PL/I Explorer view and from the main menu click Run > Run Configurations.
  2. Create a new launch configuration. You can do this in two ways:
    • Double-click the PL/I Application tree item.
    • Click PL/I Application tree item, and then click the New launch configuration icon.

    A default PL/I Launch Configuration is created in the wizard showing HelloPL/IWorld as the project to run and New_Configuration.bin/HelloPL/IWorld.exe (Windows) or New_Configuration.bin/HelloPL/IWorld (UNIX) as the main program to run.

  3. Click Run.

    This opens a console window with Hello PL/I World! printed in it.

  4. Press any key to close the console.

Preserve this project because you are going to use it again for a different demonstration included in this Introduction.

What Next?

Continue with the next tutorial, Debugging the Hello PL/I World Application, which demonstrates how to debug applications in Eclipse.