You are currently viewing AS400 create, Compile and run CLP program – HELLO WORLD

AS400 create, Compile and run CLP program – HELLO WORLD

In this discussion, I will create a program using Control Language Programming (CLP) on AS400. The output of this program is only a ‘Hello World’ message. Here are the steps:

Create Member on Source Physical File:

Press F6 = Create on SRCPF SOOLGPL/CLSRC, enter the name of the member type of program then press Enter.

Write CLP Program:

Type the following code:

PGM                                         
             SNDPGMMSG  MSG('Hellow World!')
ENDPGM                                      

In the SEU line, type FILE for the Exit and Save code that has been created then press Enter. Then it will return to the Work with Member using PDM.

Compile Source Code:

To make a program from the source code that has been created, compile the source code using the option 14=Compile on the TSTHELLOW member then press Enter. Message ‘The compile of member TSTHELLOW was submitted to batch’ appeared.

To check the compile results, type WRKSPLF then press Enter. Press F18 = Bottom to go to the last spool file. Display spool file in accordance with the name of the member created (TSTHELLOW).

If the output severity is at 0 to 19, it means that the compile is successful even though there are some notes. Usually because there are no variables or labels according to the picture above. For other severity, the compile failed and the program was not made successfully. Check the program using WRKOBJ. Through the command line, type WRKOBJ SOOLGPL/TSTHELLOW then press Enter. The program type TSTHELLOW object with the CLP attribute already exists in the SOOLGPL library.

Run CLP Program:

To run the program we need the CALL command. At the command line, type CALL SOOLGPL/TSTHELLOW then press Enter.

Message ‘Hellow World!’ appeared on the bottom of the screen.

This Post Has One Comment

Leave a Reply