Difference between revisions of "Test268 Section 4"
From MidrangeWiki
(→Code complex D-specs (e.g., OVERLAY, coding fields without attributes, etc.)) |
(→Write logic (including I/O operations) without numbered indicators) |
||
Line 49: | Line 49: | ||
=== Write logic (including I/O operations) without numbered indicators === | === Write logic (including I/O operations) without numbered indicators === | ||
+ | /Free | ||
+ | SETLL(N) (variable1:variable2) filename; | ||
+ | IF %EQUAL(filename); | ||
+ | READE(N) (variable1:variable2) filename; | ||
+ | DOW NOT %EOF(filename); | ||
+ | // logic | ||
+ | READE(N) (variable1:variable2) filename; | ||
+ | ENDDO; | ||
+ | ENDIF; | ||
+ | CHAIN (variable3) filename; | ||
+ | IF %FOUND(filename); | ||
+ | // logic | ||
+ | UPDATE filerec; | ||
+ | ENDIF; | ||
+ | /End-Free | ||
=== Code and use /Free format Calc specifications === | === Code and use /Free format Calc specifications === |
Revision as of 01:50, 9 April 2006
<< Previous Section | Home | Next Section >>
Contents
- 1 Section 4 - Advanced RPG techniques (25%)
- 1.1 Given an example of a complex logical expression, determine its results
- 1.2 Given an example of deeply-nested logic within a sample of RPG code, determine the results of running the code
- 1.3 Use Data Structure arrays
- 1.4 Code complex D-specs (e.g., OVERLAY, coding fields without attributes, etc.)
- 1.5 Use modern techniques to handle numbered indicators
- 1.6 Determine appropriate use of system APIs
- 1.7 Code subprocedures
- 1.8 Declare and use subprocedures
- 1.9 Create and use multiple occurrence data structures
- 1.10 Use externally-described data structures
- 1.11 Write logic (including I/O operations) without numbered indicators
- 1.12 Code and use /Free format Calc specifications
- 1.13 Code and use Short Form expressions (e.g., + =)
- 1.14 Translate operation codes not supported in /Free form (e.g., MOVE, CALL, etc. into /Free form)
- 1.15 Use qualified Data Structures
- 1.16 Use pointer data types
- 1.17 Code and use Named Constants
- 1.18 Prototype program Calls
- 1.19 Determine appropriate use of passing parameters by value versus by reference
- 1.20 Prototype System APIs and C functions
- 1.21 Understand the ability for RPG procedures to call and be called by Java Methods
- 1.22 Enumerate advantages of Prototypes compared with PARM and PLIST
- 1.23 Determine appropriate use for prototype keywords, such as CONST, VALUE, and OPTIONS (*NOPASS, *OMIT, *VARSIZE)
Section 4 - Advanced RPG techniques (25%)
Given an example of a complex logical expression, determine its results
Given an example of deeply-nested logic within a sample of RPG code, determine the results of running the code
Use Data Structure arrays
Code complex D-specs (e.g., OVERLAY, coding fields without attributes, etc.)
D DataStruct1 DS QUALIFIED D Field1 15A INZ('12345ABCDE12345') D Field2 5A OVERLAY(Field1) D Field3 5A OVERLAY(Field1:*NEXT) D Field4 5A OVERLAY(Field1:*NEXT) D Field5 7A OVERLAY(Field3:3) D DataStruct2 DS LIKEDS(DataStruct1) INZ(*LIKEDS)
D Name S 20 D Long_name S +5 LIKE(Name) D Lda_fld S LIKE(Name) DTAARA(*LDA)
Use modern techniques to handle numbered indicators
Determine appropriate use of system APIs
Code subprocedures
Declare and use subprocedures
Create and use multiple occurrence data structures
Use externally-described data structures
Write logic (including I/O operations) without numbered indicators
/Free SETLL(N) (variable1:variable2) filename; IF %EQUAL(filename); READE(N) (variable1:variable2) filename; DOW NOT %EOF(filename); // logic READE(N) (variable1:variable2) filename; ENDDO; ENDIF;
CHAIN (variable3) filename; IF %FOUND(filename); // logic UPDATE filerec; ENDIF; /End-Free
Code and use /Free format Calc specifications
Code and use Short Form expressions (e.g., + =)
i += 1;