Hello World Rpgle program in As400

Life@Twenty
4 min readMar 22, 2024

--

In this blog I have covered:

  1. Create Source Physical File
  2. Create RPGLE Program
  3. Edit the program
  4. Run the program
  5. Call the program

Create Source Physical File

Source Physical File is similar to a folder in which conventionally, it should contain specific type of files.

command: crtsrcpf

In File…

Fill up with the conventional source physical name as QRPGSRC as we are going to create a RPG program inside it.

In Library…

Fill up the library name you want to create it with.

In Text ‘description’ …

Fill the description. (convention)

Work with member

The source physical file QRPGSRC is also called as member. To work with those members use below command

command: wrkmbrpdm

In File… Fill up with the created member name QRPGSRC

In Library… Fill up with the created Library name as Library1

Create RPGLE Program:

In above image you can see F6 Create function key. Press F6 to create a new RPG program

Source member…

Fill with the program name

Source type…

rpgle ( same as extension in Windows as .txt, .pdf )

To see all available extensions in source type press F4 function key over it

Press Enter after filling up the name, type, description

You will be navigated to page like this

In top right corner you can see library name/source physical name

Press F10 function to go to SEU( Source Entry Utility ) type file to save the file. Press enter key.

Edit the program:

To Edit the program — Enter 2=Edit in Opt beside the program you need to Edit

Insert a new line

‘I’ for Insert. It is from SEU utilities.

Press Enter and straight below ‘Beginning of data’ start to write the code

Here Dsply is used for print any characters enclosed in single quotes.

If Integers should be printed on screen use %char to convert it into string.

To print Integer 18

use: Dsply %char(18)

*INLR=*ON is used to indicate that last record has been reached. So the program is going to be terminated.

Run the program:

Press F10 function to go to SEU( Source Entry Utility ). Type file to save the file. Press Enter.

Before Compilig the program, add the library in Edit Library List.

Enter EL in Opt.

To compile the program give 14 in Opt. Press Enter.

Give ‘Y’ to compile the file for every change in the file. Press Enter.

If no errors are present ‘completed normally’ appears. Press Enter.

Call RPGLE Program

To call the program, Enter ‘C’ in Opt. Press Enter

In console screen ‘HELLO WORLD’ is printed.

Ending note…

Following this blog I will write on ‘ SEU Commands ’

Stay happy and cheers :)

To stay updated with the blogs please follow Life@Twenty. It will really really make me to love my passion even more and more.

--

--

Life@Twenty

Hey all, one day I came to know that knowledge & experience can't be stolen from the person,but these valuables can be learnt from sharing.That's why I am here.