RPG IV - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

RPG IV

Description:

RPG IV Getting Started - Chapter 2 Objectives: Describe the RPG Specification forms Create a simple read/write RPG program Explain how to include comment lines in a ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 19
Provided by: HerbKr1
Category:
Tags: rpg

less

Transcript and Presenter's Notes

Title: RPG IV


1
RPG IV
  • Getting Started - Chapter 2

2
Objectives
  • Describe the RPG Specification forms
  • Create a simple read/write RPG program
  • Explain how to include comment lines in a program
  • Explain how to do output editing to control the
    appearance of a report

3
Specifications in RPG IV
  • Different specifications for different purposes
  • File Description Specifications
  • Input Specifications
  • Definition Specifications
  • Calculation Specifications
  • Output Specifications

4
File Description Specifications
  • File Name
  • File Type
  • File Designation
  • File Format
  • Record Length
  • Device

5
Input Specifications
  • Record Identification Entries
  • File Name
  • Sequence
  • Field Description Entries
  • Field Location
  • Decimal Positions
  • Field Name

6
Output Specifications
  • Record Identification Entries
  • File Name
  • Type
  • Exception Name
  • Space and Skip Entries
  • Field Description Entries
  • Field Name
  • Constants
  • End Position in Output Record
  • Edit Codes

7
Pseudocode for Program
8
Calculation Specifications
  • Except
  • Read
  • Dow
  • Enddo
  • Eval
  • Return

9
Internal Documentation
  • Comment lines
  • in position 7

10
Completed Program - F I
  • ..1........2........3........4........5....
    ....6........7........8
  • F
  • F This program produces a weekly sales report.
    The report data comes
  • F directly from input file SalesMast.
  • F Author J. Yaeger Date Written
    12/10/94
  • F
  • ..1........2........3........4........5....
    ....6........7........8
  • FilenameIP FRlen Device
  • FSalesMast IF F 63 DISK
  • FQPRINT O F 132 PRINTER
  • ..1........2........3........4........5....
    ....6........7........8
  • IilenameSq
  • ISalesMast NS
  • I FromToDcField
  • I 1 4
    0SlspNumber
  • I 5 34
    SlspName
  • I 35 50
    ItemNumber
  • I 51 56
    0DateOfSale
  • I 57 63 2Price

11
Completed Program - C Spec
  • ..1........2........3........4........5....
    ....6........7........8
  • C Factor1Opcode(E)Factor2Result
    LenDcHiLoEq
  • C EXCEPT Headings
  • C READ SalesMast
  • C DOW NOT EOF
  • C EXCEPT Detail
  • C READ SalesMast
  • C ENDDO
  • C EVAL INLR ON
  • C RETURN

12
Completed Program - O Headings Spec
  • ..1........2........3........4........5....
    ....6........7........8
  • OilenameD ExceptnameBASbSa
  • OQPRINT E Headings 2 2
  • ..1........2........3........4........5....
    ....6........7........8
  • O FieldY End
    Constant/Editword
  • O 8
    'PAGE'
  • O PAGE 13
  • O 50
    'WEEKLY SALES REPORT'
  • O 64
    'DATE'
  • O UDATE Y 73
  • O E Headings 1
  • O 7
    'SLSPSN.'
  • O 48
    'DATE OF'
  • O 77
    'SALE'
  • O E Headings 2
  • O 3
    'NO.'
  • O 21
    'NAME'
  • O 46
    'SALE'
  • O 61
    'ITEM SOLD'

13
Completed Program - O Detail Spec
  • ..1........2........3........4........5....
    ....6........7........8
  • OilenameD ExceptnameBASbSa
  • O E Detail 1
  • ..1........2........3........4........5....
    ....6........7........8
  • O FieldY End
    Constant/Editword
  • O SlspNumber 4
  • O SlspName 37
  • O DateOfSale Y 48
  • O ItemNumber 67
  • O Price 1 79

14
Edit Codes
15
Edit Words
16
Points to Remember
  • RPG programs are written as fixed-form
    specifications.
  • Different specification forms convey different
    kinds of information to the RPG compiler
  • File Specifications contain descriptions of all
    files used within a program.

17
Points to Remember (cont)
  • Input Specifications provide detail information
    about each program described input file used by a
    program.
  • Calculation Specifications center on operations,
    or processing steps, to be accomplished by the
    computer.
  • Output Specifications provide details about each
    program-described output file.

18
Points to Remember (cont)
  • It generally is customary to edit numeric values
    that are printed.
  • Comment lines, signaled by an in position 7 of
    a specification line, can appear anywhere within
    a program.
Write a Comment
User Comments (0)
About PowerShow.com