1 / 25

Welcome to RPG544

Welcome to RPG544. Bit about Cindy. Administrative Stuff. Standards Due Dates Web Page. RPG IV. R – Report P – Program G – Generator Version 4. History of RPG. 1964: RPG - Report Program Generator 1969: RPG II With release of System/3 1979: RPG III Interactive programming Database

dino
Download Presentation

Welcome to RPG544

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Welcome to RPG544

  2. Bit about Cindy

  3. Administrative Stuff • Standards • Due Dates • Web Page

  4. RPG IV R – Report P – Program G – Generator Version 4

  5. History of RPG • 1964: RPG - Report Program Generator • 1969: RPG II • With release of System/3 • 1979: RPG III • Interactive programming • Database • Structured Programming • 1988: RPG/400 • Upgrade to RPG III • 1994: RPG IV • Integrated Language Environment (ILE) • Modular Programming

  6. Things that made RPG unique • Program Cycle Read a record Loop until Eof process the record read a record End of loop • Indicators

  7. Specifications • Programs are organized in a series of specifications and appear in this order

  8. H-Specs (Control Specifications) • Default formats (eg. Date formats) • Changes to normal processing modes • Eg changing the internal method that the program uses to evaluate expressions • Special options to use when compiling the program • Language enhancements that effect the entire program H Datfmt(*ISO) Timfmt(*HMS)

  9. F-Specs

  10. D-Specs (Definition) • Standalone variables • Named constants • Data Structures • Prototypes • Procedure Interfaces

  11. D-Specs • Data name • 15 characters • Must start with a letter of the alphabet or $, # or @ • Remaining characters must be letters, numbers, _, #, $ or @ • Declaration Type • DS – Data Structure • C – Constant • PR – Procedure • PI – Procedure Interface • S – Standalone Variable

  12. D-Specs • Length • Length of Data • Decimal Places • Number of decimal places • Data type

  13. I-Specs (Field Definition) • Used to define fields in the file

  14. C-Specs (Calculation) • Program logic! Factor1 Opcode Factor2 Result Indicators • RPG IV introduces free form RPG for C-Specs

  15. O-Specs (Output) • Define the output of the program. May be report definitions or database.

  16. P-Specs • Will discuss later in the course

  17. Add qty1 add qty2 qty3 or add qty qty3

  18. Sub qty1 sub qty2 diff or sub qty diff

  19. Mult price mult qty sales or mult 0.14 sales

  20. Div sales div qty price or div qty sales

  21. Read • Reads the next record from a database object (sequential read) read sales 99 will ‘turn on’ indicator 99 if the end of file is reached.

  22. EXCPT (EXCEPT) • Writes output to printer files excpt format

  23. IF • RPG, RPGII, RPGIII • IFEQ, IFNE, IFLE, IFLT, IFGT, IFGE, etc • Ends with endif qty ifeq 0 endif • RPGIV free format • If • Ends with endif If qty = 0; Endif;

  24. Do Loops • RPG, RPGII, RPGIII • DOWEQ, DOWNE, DOUEQ, DOUNE etc • Ends with ENDDO Qty Doweq 0 enddo • RPGIV free format • DOW, DOU • Ends with ENDDO Dow qty < 0; enddo;

  25. Itempgm Demo

More Related