Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Treat an Alpha field as Numeric and any blank values as Zeros.

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

  • Treat an Alpha field as Numeric and any blank values as Zeros.

    How about this?
     D STRING S 10A C EVAL STRING=' 1234 ' C ' ':'0' XLATE STRING STRING C DSPLY STRING C C SETON LR C RETURN 
    Of course, this does not do any testing to insure that the string is numeric. All it does is replace the blanks with zeros. HTH, Joe

  • #2
    Treat an Alpha field as Numeric and any blank values as Zeros.

    A developer here at work wants to reproduce the following DB2 query in SQL on our AS400. SELECT CONVERT(INT, ISNULL(Inspection_Notel,0)) + 10 FROM inspection_tab What this is doing is taking an alpha field, telling it that all value in it are numeric and any blank values are zeros. Anybody have any ideas how to reproduce this on the AS400??

    Comment

    Working...
    X