# RPGLE Free Format (Hello World)

URL: https://as400i.com/2019/10/17/rpgle-free-format-hello-world/
Topic: RPG and programming, lesson 3 of 6
Author: Yasiru Rangana
Published: 17 October 2019

Today RPGLE supports fully free formatting. It is similar to other languages such as [JAVA](https://www.java.com), PHP and can be understood easily. Programmers who are familiar with other modern languages can more learn RPGLE.

There are numerous advantages in Free Format RPGLE over legacy fixed format.

## Differences between Free Format vs Legacy Fixed Format

RPG has two modes of free-form code. The historical/legacy mode (column-limited mode) requires that all free-form code must be coded between columns 8 and 80. Fully-free mode allows free-form code in any column, with no limit on line-length.

Fully free-form source must have \*\*FREE in column 1 of line 1. All the code must be free-form.

Non-fully-free source, or column-limited source does not have \*\*FREE in line 1. You can mix fixed-form code (code that uses columns 6 and 7) and free-form code in column-limited source.

This tutorial assumes you have \*\*FREE at the beginning of your source, but it also works if you use column-limited source, if you ensure that columns 1-7 are blank and that you don’t go past column 80. The examples have 7 blanks at the beginning to make it easy to copy and paste into column-limited source, but if you have \*\*FREE at the beginning of your source, you can remove those blanks if you like.

## Lets try a small hello world example in Free Format RPGLE.

Create a member “helloworld” in your working source physical file. Give the type of this member as “RPGLE”. Now type the following code in the source member.

![](https://as400i.com/images/2019/10/Free-Format-Hello-World.png)

RPGLE FREE FORMAT (Hello World)

No need to worry about positioning like we did on [Fixed format RPGLE](https://as400i.com/2013/03/20/simple-rpgle-program-hello-world/). But remember to use semicolon (;) at the end of each line.

Now compile the module. Create the program and call it, It Will display the phrase Hello World.

## Compile the program

-   If you are using [RDi](https://as400i.com/2020/04/07/ibm-rdi/), you can compile from the menu within the editor, or you can save your changes and compile by right-clicking on the member in the navigation. Either way, select the _**CRTBNDRPG**_ command, and take all the defaults.

-   If you are using [SEU](https://as400i.com/2013/03/13/using-the-source-entry-utility-seu-as400/), exit the editor by using _**F3**_, and compile by using option _**14**_. You could also compile from the command line by using the _**CRTBNDRPG**_ command, and by using _**F4**_ to prompt the command.

## Run RPGLE Free Format (Hello World)

-   Use the _**CALL**_ command to call the HELLOWORLD program, substituting the name of your library for yourlibrary.===> CALL yourlibrary/HELLOWORLD

-   It puts up a message saying “**DSPLY Hello World**“

-   Just press **ENTER** to end the program.
