Difference between revisions of "Test268 Section 3"

From MidrangeWiki
Jump to: navigation, search
(Define basic arrays (e.g., compile time, pre-run time, run time) using D specs)
(Define basic arrays (e.g., compile time, pre-run time, run time) using D specs)
Line 22: Line 22:
 
  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords++++++++++++++++++++
 
  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords++++++++++++++++++++
 
  DARC              S              3A  DIM(12) PERRCD(5) CTDATA
 
  DARC              S              3A  DIM(12) PERRCD(5) CTDATA
 +
 +
// Must be at the end of the code
 
  **CTDATA ARC
 
  **CTDATA ARC
 
  48K16343J64044HComments can be placed here
 
  48K16343J64044HComments can be placed here
Line 34: Line 36:
 
Figure 68. Definition Specifications for Different Types of Arrays
 
Figure 68. Definition Specifications for Different Types of Arrays
  
*....+....1....+....2....+....3....+....4....+....5....+....6....+....*
+
HKeywords+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      HKeywords+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
H DATFMT(*USA) TIMFMT(*HMS)
      H DATFMT(*USA) TIMFMT(*HMS)
+
D*ame+++++++++++ETDsFrom+++To/L+++IDc.Keywords++++++++++++++++++++
      D*ame+++++++++++ETDsFrom+++To/L+++IDc.Keywords++++++++++++++++++++
+
  * Run-time array.  ARI has 10 elements of type date. They are
      * Run-time array.  ARI has 10 elements of type date. They are
+
  * initialized to September 15, 1994.  This is in month, day,
      * initialized to September 15, 1994.  This is in month, day,
+
  * year format using a slash as a separator as defined on the
      * year format using a slash as a separator as defined on the
+
  * control specification.
      * control specification.
+
DARI              S              D  DIM(10) INZ(D'09/15/1994')
      DARI              S              D  DIM(10) INZ(D'09/15/1994')
+
  *
      *
+
  * Compile-time arrays in alternating format.  Both arrays have
      * Compile-time arrays in alternating format.  Both arrays have
+
  * eight elements (three elements per record).  ARC is a character
      * eight elements (three elements per record).  ARC is a character
+
  * array of length 15, and ARD is a time array with a predefined
      * array of length 15, and ARD is a time array with a predefined
+
  * length of 8.
      * length of 8.
+
DARC              S            15    DIM(8) PERRCD(3)
      DARC              S            15    DIM(8) PERRCD(3)
+
D                                    CTDATA
      D                                    CTDATA
+
DARD              S              T  DIM(8) ALT(ARC)
      DARD              S              T  DIM(8) ALT(ARC)
+
  *
      *
+
  * Prerun-time array.  ARE, which is to be read from file DISKIN,
      * Prerun-time array.  ARE, which is to be read from file DISKIN,
+
  * has 250 character elements (12 elements per record).  Each
      * has 250 character elements (12 elements per record).  Each
+
  * element is five positions long.  The size of each record
      * element is five positions long.  The size of each record
+
  * is 60 (5*12). The elements are arranged in ascending sequence.
      * is 60 (5*12). The elements are arranged in ascending sequence.
+
DARE              S              5A  DIM(250) PERRCD(12) ASCEND
      DARE              S              5A  DIM(250) PERRCD(12) ASCEND
+
D                                    FROMFILE(DISKIN)
      D                                    FROMFILE(DISKIN)
+
  *
      *
+
  * Prerun-time array specified as a combined file.  ARH is written
      * Prerun-time array specified as a combined file.  ARH is written
+
  * back to the same file from which it is read when the program
      * back to the same file from which it is read when the program
+
  * ends normally with LR on.  ARH has 250  character elements
      * ends normally with LR on.  ARH has 250  character elements
+
  * (12 elements per record).  Each elements is five positions long.
      * (12 elements per record).  Each elements is five positions long.
+
  * The elements are arranged in ascending sequence.
      * The elements are arranged in ascending sequence.
+
DARH              S              5A  DIM(250) PERRCD(12) ASCEND
      DARH              S              5A  DIM(250) PERRCD(12) ASCEND
+
D                                    FROMFILE(DISKOUT)
      D                                    FROMFILE(DISKOUT)
+
D                                    TOFILE(DISKOUT)
      D                                    TOFILE(DISKOUT)
+
 +
// Must be at the end of the code
 
  **CTDATA ARC
 
  **CTDATA ARC
 
  Toronto        12:15:00Winnipeg      13:23:00Calgary        15:44:00
 
  Toronto        12:15:00Winnipeg      13:23:00Calgary        15:44:00

Revision as of 21:05, 5 December 2005

<< Previous Section | Home | Next Section >>

Section 3 - Core RPG (15%)

Recognize appropriate use of RPG creation commands (e.g., CRTxxxPGM, CRTxxxMOD, CRTPGM, CRTBNDxxx)

  • CRTxxxPGM
    • Used for compiling a RPG ILE 4 program without the "NOMAIN" H-Spec
  • CRTxxxMOD
    • Used for compiling a RPG ILE 4 program with the "NOMAIN" H-Spec
  • CRTPGM
  • CRTBNDxxx

Define basic arrays (e.g., compile time, pre-run time, run time) using D specs

  • Compile Time
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords++++++++++++++++++++
DARC              S              3A   DIM(12) PERRCD(5) CTDATA

// Must be at the end of the code
**CTDATA ARC
48K16343J64044HComments can be placed here
12648A47349K346Comments can be placed here
50B125         Comments can be placed here


  • Pre-Run Time

Figure 68 shows the definition specifications required for two prerun-time arrays, a compile-time array, and a run-time array. Figure 68. Definition Specifications for Different Types of Arrays

HKeywords+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
H DATFMT(*USA) TIMFMT(*HMS)
D*ame+++++++++++ETDsFrom+++To/L+++IDc.Keywords++++++++++++++++++++
 * Run-time array.  ARI has 10 elements of type date. They are
 * initialized to September 15, 1994.  This is in month, day,
 * year format using a slash as a separator as defined on the
 * control specification.
DARI              S               D   DIM(10) INZ(D'09/15/1994')
 *
 * Compile-time arrays in alternating format.  Both arrays have
 * eight elements (three elements per record).  ARC is a character
 * array of length 15, and ARD is a time array with a predefined
 * length of 8.
DARC              S             15    DIM(8) PERRCD(3)
D                                     CTDATA
DARD              S               T   DIM(8) ALT(ARC)
 *
 * Prerun-time array.  ARE, which is to be read from file DISKIN,
 * has 250 character elements (12 elements per record).  Each
 * element is five positions long.  The size of each record
 * is 60 (5*12). The elements are arranged in ascending sequence.
DARE              S              5A   DIM(250) PERRCD(12) ASCEND
D                                     FROMFILE(DISKIN)
 *
 * Prerun-time array specified as a combined file.  ARH is written
 * back to the same file from which it is read when the program
 * ends normally with LR on.  ARH has 250  character elements
 * (12 elements per record).  Each elements is five positions long.
 * The elements are arranged in ascending sequence.
DARH              S              5A   DIM(250) PERRCD(12) ASCEND
D                                     FROMFILE(DISKOUT)
D                                     TOFILE(DISKOUT)

// Must be at the end of the code
**CTDATA ARC
Toronto        12:15:00Winnipeg       13:23:00Calgary        15:44:00
Sydney         17:24:30Edmonton       21:33:00Saskatoon      08:40:00
Regina         12:33:00Vancouver      13:20:00
  • Run Time
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++
DARC              S              3A   DIM(12)

Use basic array handling (e.g., *IN, LOOKUP, SORTA, MOVE and MOVEA, indexing)

Code and use figurative constants (e.g., *LOVAL, *HIVAL, *ALL, *BLANKS, *ZEROS, *ON, *OFF)

  • *ALL
  • *BLANKS
  • *HIVAL
  • *LOVAL
  • *OFF
  • *ON
  • *ZEROS

Code and use job date and system date

Code and use structured operation codes (e.g., DO DOUxx, DOWxx, IF/ELSE/ELSEIF, SELECT/WHEN, CASxx/EXSR)

Code and use structured operation codes with expressions (+, -, * ,/, **, <, >, =, (), and, or, not)

Code and use date data types and arithmetic operations, including date operations in expressions

Code and use SDS

See Program Status Data Structure

Code and use *INZSR

Code and use RPG IV built-in functions

See Built In Functions

Use the H-spec keywords

See H-Spec Keywords

Use RPG IV OpCodes (e.g., Arithmetic, Date, Message, Array, Declarative, File, Branching, Indicator setting, String handling, Structured programming, compare, initialization, subroutine, data area)

Use the D-spec keywords

See D-Spec Keywords


<< Previous Section | Home | Next Section >>