On 21/10/2009, at 1:01 AM, Christen, Duane wrote:
Yes, CLEAR on a DS blanks numeric subfields.
:quote.
CLEAR (Clear)
Free-Form Syntax CLEAR {*NOKEY} {*ALL} name
Code Factor 1 Factor 2 Result Field Indicators
CLEAR *NOKEY *ALL name (variable or record format)
The CLEAR operation sets elements in a structure (record format, data
structure,
array, or table) or a variable (field, subfield, array element or
indicator), to their
default initialization value depending on field type (numeric,
character, graphic,
UCS-2, indicator, pointer, or date/time/timestamp). For the default
initialization
value for a data type, see “Chapter 10. Data Types and Data Formats”
on page 165.
If the structure or variable being cleared is variable-length, its
length changes to 0.
The CLEAR operation allows you to clear structures on a global basis,
as well as
element by element, during run time.
:equote.
Operative part of that quote is "elements in a structure" ... see the
example code in the RPG Reference for clarification.
The only issue is where a character field and numeric field overlap in
which case the order in which they appear in the structure determines
the final initialised value.
Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists
http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.