Anonymous Says:
It will abend with a s0c7 whenever you try to access that field, but not when you move data to it. You should always validate a scenario like this just because it will prevent future abend someday down the road as you never know when the input data will change especially if its coming from elsewhere.
I would code the check like this.
Set flag-good to true
If WS-NUM-IN is numeric
If WS-NUM-IN = 0
Set flag-good to false
End-if
Else
Set flag-good to false
End-if
That will cover it either way if there any type of garbage in the field or zeros in the field.
|