Set Up the HelloPLIWorld Project

Walks you through the process of creating an Enterprise Developer project, adding PL/I source, and then running the resulting application.

Create a project

  1. In Eclipse on the Application Explorer view, expand the Enterprise Developer system.
  2. Right-click Enterprise Development Projects and select New PL/I Project > PL/I Project from the context menu.
  3. Type HelloPLIWorld into the Project Name field.

    The default location for storing new projects is the workspace you specified when you started Eclipse. If you wanted to change this, you could uncheck Use default location and specify a different location; however, you use the default location in this tutorial.

  4. Click Finish.

Add a source file

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

  1. In the PL/I Explorer view, right-click the HelloPLIWorld project, and then select New > PL/I Source File from the context menu.

    The New PL/I Source File wizard is displayed.

  2. In the New file name field type HelloPLIWorld.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:
    HelloPLIWorld: proc options (main);
      DCL SourceString    CHAR(10);
      DCL testchar        CHAR;
      DCL loop            FIXED BIN(8);
      
      SourceString = "AAbbAAbbCC";
      DO loop = 1 TO 10 BY 1;
        testchar = SUBSTR(SourceString, loop, 1);
        IF testchar = "A" THEN
          SUBSTR(SourceString, loop, 1) = "D";
      END;
      PUT SKIP LIST(SourceString);
      
      loop = 1;
      DO WHILE (loop < 10) UNTIL (SUBSTR(SourceString, loop, 1) = "C");
        SUBSTR(SourceString, loop, 1) = "Q";
        loop = loop + 1;
      END;
      put skip list("Hello PL/I World!");
    end HelloPLIWorld;
  5. Click File > Save.

    Eclipse automatically builds your project. The progress of the project build is displayed in the Console view.

  6. In the PL/I Explorer view, expand HelloPLIWorld > New_Configuration.bin to see the generated build files.

Create a debug configuration

  1. Select HelloPLIWorld in PL/I Explorer and from the main menu click Run > Debug Configurations.
  2. Double-click the PL/I Application tree item to create a new debug configuration.
  3. Specify HelloPLIWorld as the name of the configuration.

    This configuration uses HelloPLIWorld as the project to run and New_Configuration.bin/HelloPLIWorld as the main program to run.

  4. Click Apply and Close to return to the PL/I Explorer view.