welcome to rpg544. bit about cindy administrative stuff standards due dates web page

25
Welcome to RPG544

Upload: willa-arnold

Post on 05-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

Welcome to RPG544

Page 2: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

Bit about Cindy

Page 3: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

Administrative Stuff

• Standards

• Due Dates

• Web Page

Page 4: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

RPG IV

R – Report

P – Program

G – Generator

Version 4

Page 5: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

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

Page 6: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

Things that made RPG unique

• Program CycleRead a record

Loop until Eof

process the record

read a record

End of loop

• Indicators

Page 7: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

Specifications

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

Spec Type Description When Introduced

H Header (control) RPG

F File RPG

D Definition RPG IV

I Input RPG

C Calculation RPG

O Output RPG

P Procedure RPG IV

Page 8: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

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)

Page 9: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

F-Specs

Position Use Position Use

7-16 File Name 23-27 Record Length

For program described

17 File Type

(I, U, or O)

36-49 Device

Disk, Printer, Workstation

18 File Designation

Blank – output file

F – Full Procedural

P – Primary File (logic cycle)

S – Secondary File (logic Cycle)

R – Record address file

T – Table

44-80 Keywords

(see appendix A of text book)

22 File Format

F – Program Described

E – Externally Described

Page 10: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

D-Specs (Definition)

• Standalone variables

• Named constants

• Data Structures

• Prototypes

• Procedure Interfaces

Page 11: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

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

Page 12: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

D-Specs

• Length– Length of Data

• Decimal Places– Number of decimal places

• Data type

Page 13: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

I-Specs (Field Definition)

• Used to define fields in the filePos Use Pos Use

7 – 16 Filename 36 Data Type

17 – 18 Sequence

NS – if no sequence required

2 digit number if sequence is required

37 – 46 Field Location

19 Number

Leave blank

47 – 48 Decimal Positions

Required by numeric fields

20 Option

Leave blank

49 – 62 Field Name

6 characters up to RPGIII

14 characters RPG IV

21 – 22 Record id (indicator)

Page 14: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

C-Specs (Calculation)

• Program logic!

Factor1 Opcode Factor2 Result Indicators

• RPG IV introduces free form RPG for C-Specs

Page 15: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

O-Specs (Output)

• Define the output of the program. May be report definitions or database.

Pos Use Pos Use

7-16 FileName 30 - 43 Field Names

17 Type

D-Detail

H-Header

E-Exception

T-Total

53 – 80 Constants / Edit Word

30 – 39 Exception Name 47 – 51 End Position

40 – 45 Skip and Space Entries 52 Edit code

Page 16: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

P-Specs

• Will discuss later in the course

Page 17: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

Add

qty1 add qty2 qty3

or

add qty qty3

Page 18: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

Sub

qty1 sub qty2 diff

or

sub qty diff

Page 19: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

Mult

pricemult qty sales

or

mult 0.14 sales

Page 20: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

Div

sales div qty price

or

div qty sales

Page 21: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

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.

Page 22: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

EXCPT (EXCEPT)

• Writes output to printer files

excpt format

Page 23: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

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;

Page 24: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

Do Loops

• RPG, RPGII, RPGIII– DOWEQ, DOWNE, DOUEQ, DOUNE etc– Ends with ENDDO

Qty Doweq 0enddo

• RPGIV free format– DOW, DOU– Ends with ENDDO

Dow qty < 0;enddo;

Page 25: Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page

Itempgm Demo