ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

testn

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • testn

    Dear all,
    Let me know the concept of TESTN opcode and how it works ?


    With regards
    sudha
    The Secret Of Achieving Your Goals Is Revealed Before Your Eyes.
    System Engineer

    Sudha...

  • #2
    Re: testn

    The TESTN operation tests a character result field for the presence of zoned
    decimal digits and blanks. The result field must be a character field. To be
    considered numeric, each character in the field, except the low-order character,
    must contain a hexadecimal F zone and a digit (0 through 9). The low-order
    character is numeric if it contains a hexadecimal C, hexadecimal D, or hexadecimal
    F zone, and a digit (0 through 9). Note that the alphabetic characters J through R,
    should they appear in the low-order position of a field, are treated as negative
    numbers by TESTN.

    PHP Code:
    CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
    *
    The field values are FieldA 123FieldB 1X4FieldC 004,
    FieldD bbbFieldE b1b3, and FieldF b12.
    *
    Indicator 21 is set on because FieldA contains all numeric
    characters.
    C TESTN FieldA 21
    Indicator 22 is set on because FieldA contains all numeric
    charactersIndicators 23 and 24 remain off.
    C TESTN FieldA 222324
    All indicators are off because FieldB does not contain valid
    numeric data.
    C TESTN FieldB 252627
    Indicator 28 is set on because FieldC contains valid numeric data.
    Indicators 29 and 30 remain off.
    C TESTN FieldC 282930
    Indicator 33 is set on because FieldD contains all blanks.
    Indicators 31 and 32 remain off.
    C TESTN FieldD 313233
    Indicators 3435, and 36 remain offIndicator 35 remains off
    off because FieldE contains a blank after a digit.
    C TESTN FieldE 343536
    Indicator 38 is set on because FieldF contains leading blanks and
    valid numeric charactersIndicators 37 and 39 remain off.
    C TESTN FieldF 373839 
    Last edited by FaStOnE; October 9, 2006, 12:57 PM.

    Comment

    Working...
    X