IBC233 Lecture 3 Updated Fall 2011
200 likes | 412 Vues
IBC233 Lecture 3 Updated Fall 2011. Homework. Finish up Lab 2 Work on Lab 3. Agenda . Review Edit Words The Printing Story Library Lists Display Files RPG. Edit Words. Used to make numbers more readable Example Your number is 01234 The default display is 1,234
IBC233 Lecture 3 Updated Fall 2011
E N D
Presentation Transcript
Homework • Finish up Lab 2 • Work on Lab 3
Agenda • Review • Edit Words • The Printing Story • Library Lists • Display Files • RPG
Edit Words • Used to make numbers more readable • Example Your number is 01234 The default display is 1,234 You want it displayed as 012-34 Then the EDTWRD would be (‘0♪♪♪-♪♪‘) (♪ means 1 blank space)
The Printing Story • Why is printing so darn difficult? • Printing at home
Playing with your Library List • ADDLIBLE – Add library List Entry • RMVLIBLE – Remove Library List Entry • EDTLIBL – Edit Library List • CHGLIBL – Change Library List • CHGCURLIB – Change Current Library
Display Files • File objects • hold screen design • constants or literals • system constants (date, time, user) • fields
Display Files and Programs MARKSDSP *FILE MARKSRPG *PGM
RPG Report Program Generator
Indicators • Boolean variables – predfined • *IN00 - *IN24 function keys • *INLR – last record indicator • How we end RPG programs • Have the values: • ‘0’ or *OFF • ‘1’ or *ON
F-spec • How we define files File Type: I/U/C File Designation: F/P File Addition: A or blank File Format: E or F Record Address Type: K or Blank Device: Disk/Printer/Workstn
EXFMT • Displays a screen and waits for input eg. EXFMT RECORD1;
WRITE • Writes a record format to a file
Loops - DOU dou X > 10; Total = Total + Array(x); X = X + 1; enddo;
Loops – DOW dow (a <= 5) and (b + c = 0); exsr nextRecord; enddo;
Subroutines • Blocks of logic • Execute a subroutine – EXSR • Define a subroutine BEGSR subName; ENDSR;
IF Statements IF condition; ELSE; ENDIF’
Select Statements SELECT; WHEN condition; statements; WHEN condition; statements; OTHER; statements; ENDSL;