Introduction to RPG programming in AS400

Introduction to RPG programming in AS400
Introduction to RPG programming in AS400, hello world program in rpg, ile in rpg, ibmi,rpg, rpg introduction, basic of rpg programming, rpgiii, rpgiv, rpgle, rpgile, ilerpg, rpg,
Introduction to RPG programming in AS400

RPG

  • The full form of RPG is the Report program generator.
  • High-Level programming language.
  • Developed by IBM in 1959.
  • Available only on IBM i or OS/400 systems.
  • The current version used is RPG IV aka RPGLE or ILE RPG.
  • It was earlier designed to generate reports from the data file.
  • RPGII

  • After RPG language, RPG II came with updates to RPG
  • Fixed format programming language.
  • RPG III

  • After RPG II, RPG III came to the picture and was developed for System38.
  • The updates that came to RPG III are much enhanced since Control Statements such as IF and ENDIF, Loops, and Subroutines were added to it.
  • RPGIV

  • RPG IV was released in 1994.
  • Then RPG IV the current version came into the picture which has more enhanced features over RPG III.
  • ILE (Integrated Language Environment) feature added to RPG IV.
  • ILE Features in RPGIV:

  • Free-format Calculation coding support.
  • CALLP and EVAL become optional opcode in /FREE specs.
  • With the v7r1 TR7(Technology Refreshes) upgrade, the /FREE and /END-FREE are no longer necessary as well.
  • Embedded SQL can be used. During Compile, The SQL precompiler first converts the SQL statements into RPG statements which call the Database managers program to interact with the Database SQL Query Engine and returns the feedback to the program.
  • Hello World program in RPGLE

          /Free 
            DSPLY 'Hello World';
            *INLR = *ON; 
           /End-Free  
    
  • The /Free and /End-Free would be written at the 7th position on the source line in the RPG program.
  • No other code would be started from the 7th position within /Free and /End-Free blocks. Hence, it is clear that one must start writing the source after the 7th position or can say from the 8th position.
  • Every statement must be terminated with a semi-colon (;).
  • DSPLY operation code will display the message on the Workstation display.
  • *INLR = *ON, This line will set the Last Record indicator as ON and all the allocated resources will be released and the program ends at this point.
  • **FREE 
    DSPLY 'Hello World';
    *INLR = *ON; 
    

    Related Post

    Post a Comment

    © AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain