1 / 21

RPG III

RPG III. C Specs - Opcodes. Add. qty1 add qty2 qty3 or add qty qty3. Sub. qty1 sub qty2 diff or sub qty diff. Mult. price mult qty sales or mult 0.14 sales. Div. sales div qty price or div qty sales. Read.

Download Presentation

RPG III

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. RPG III

  2. C Specs - Opcodes

  3. Add qty1 add qty2 qty3 or add qty qty3

  4. Sub qty1 sub qty2 diff or sub qty diff

  5. Mult price mult qty sales or mult 0.14 sales

  6. Div sales div qty price or div qty sales

  7. 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.

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

  9. SETON • Sets an indicator to ‘1’ seton 99

  10. SETOF • Sets an indicator to ‘0’ setof 99

  11. 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;

  12. 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;

  13. Externally Described Files - SQL • Physical files created with SQL are a problem for RPG as the record format name is the same as the file name. • Use rename to resolve this SALESmast IF E DISK rename(salesmast:salesmastr)

  14. Itempgm2 Demo

  15. CVTRPGSRC • Converts an RPGIII program to RPGIV • Expands factor sizes • Substitutes 5 character opcodes for 6 character equivalents • Creates definition specs for tables and arrays

  16. EVAL • Executes an expression • RPG IV only • As an assignment eval *inlr = *on • As a mathematical expression eval counter = counter + 1

  17. %eof function • RPGIV only • Checks the physical file for the end of file condition • Returns ‘1’ if end of file • Returns ‘0’ is a record is found Syntax: %eof(sales)

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

  19. 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

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

  21. Itempgm3 Demo

More Related