IBM AS/400 Frozen Dessert Maker User Manual


 
Sample Source for Debug Examples
* Pointers
D NullPtr S * INZ(*NULL)
D BasePtr S * INZ(%ADDR(String))
D ProcPtr S * ProcPtr INZ(%PADDR('c_proc'))
D BaseString S 6A BASED(BasePtr)
D BaseOnNull S 10A BASED(NullPtr)
*
D Spcptr S *
D SpcSiz C 8
* Date, Time, Timestamp
D BigDate S D INZ(D'9999-12-31')
D BigTime S T INZ(T'12.00.00')
D BigTstamp S Z INZ(Z'9999-12-31-12.00.00.000000')
* Array
D Arry S 3S 2 DIM(2) INZ(1.23)
* Table
D TableA S 3 DIM(3) CTDATA
*-----------------------------------------------------------------*
* Define different types of data structures.
*-----------------------------------------------------------------*
D DS1 DS OCCURS(3)
D Fld1 5A INZ('ABCDE')
D Fld1a 1A DIM(5) OVERLAY(Fld1)
D Fld2 5B 2 INZ(123.45)
*
D DS2 DS 10 OCCURS(2)
*
D DS3 DS
D Title 5A INZ('Mr. ')
D LastName 10A INZ('Jones ')
D FirstName 10A INZ('Fred ')
*-----------------------------------------------------------------*
* Define prototypes for called procedures c_proc and switch
*-----------------------------------------------------------------*
D c_proc PR * EXTPROC('c_proc')
D size 10U 0 VALUE
D inzval 1A CONST
D Switch PR
D Parm 1A
*-----------------------------------------------------------------*
* Define parameters for non-prototyped call
* PARM1 is used when calling RPGPROG program.
*-----------------------------------------------------------------*
D PARM1 S 4P 3 INZ(6.666)
D EXPORTFLD S 6A INZ('export') EXPORT
Figure 105 (Part 2 of 4). Source for Module DBGEX
Chapter 11. Debugging Programs 213