Simple RPGLE Program (Hello World)

First RPGLE Program

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.

HELLO WORLD

HELLO WORLD

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

That is a basic RPGLE program but you learn several things as discussed below.

  • The C specs is mentioned on the 6th place. Other specifications are also specified at this place only. Other specifications are H, F,D, I and P. (Specifications O and E are RPG specifications)
  • The text Hello world is written at ‘Factor one’ position. i.e at the 12th place. At this place we specify the factor one of any operation code in RPGLE. You will use this factor frequently for declaring keylists of file and defining parameter list.
  • The Op codes in RPGLE. The opcodes are placed at the position starting from 26. In the example above we have used two opcodes dsply and Return.
  • Dsply – This opcode is used to display any text as the output. The program does not stop execution but halts for a small time. When you press the return key. The subsequent statements are executed. This opcode can be used to display a text of maximum 52 length.
  • Return – This opcode is a required keyword. When the program runs this statement, it terminates its execution and returns to the calling program immediately. In the example above the caller is the system as we have called this program from command line, hence the program will end when it executes the return statement.

Advertisements

Posted on March 20, 2013, in RPGLE and tagged , , , . Bookmark the permalink. 6 Comments.

  1. Why viewers still use to read news papers when
    in this technological world the whole thing is accessible on net?

  2. Hi there I am so excited I found your blog page, I really
    found you by error, while I was browsing on Bing for something else,
    Anyhow I am here now and would just like to say thanks a lot for a marvelous
    post and a all round entertaining blog (I also love the
    theme/design), I don’t have time to read through it all at the
    moment but I have book-marked it and also included your RSS feeds, so when I have time I will be back to read a great deal
    more, Please do keep up the great work.

  3. I haven’t checked in here for a little while because I thought it was
    getting uninteresting, but the last few posts are actually good quality
    so I guess I’ll add you back to my daily bloglist. You deserve
    it my buddy.

  4. all the time i used to read smaller content that also
    clear their motive, and that is also happening with this paragraph which I am
    reading here.

  5. As someone who has just started to look at RPG this was very handy.

  1. Pingback: ILE RPG, RPG IV Specifications (H, F, D, I, C, O and P) | AS/400 ISeries

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: