moving space to a numeric field will initialize it with zeroes (compiler message: COBCH1026E Source literal is non-numeric - substituting zero). A numeric test is succesfull (which causes consequential error). Is there a directive to avoid this - I didn't find any.
thanks in advance
Harald
This only occurs during compilation if the compiler recognizes a statement that is trying to move an illegal value into a numeric field as this is not allowed.
So if you have something like:
01 my-group.
     05 num-field  pic 9(5).
01 aspace pic x value space.
    and you try:
    move space to num-field   *> you will get zero substitution because compiler knows illegal value
    but if you use instead the data-item aspace
    move aspace to num-field *> no compiler error but you may get rts163 error at run-time. if test for 0 fails
    if you move spaces to the group item you will not get compiler error but may get rts163 error at run-time but if test for 0 fails
           move space to my-group
           if num-field = 0
              display "yes"
           else
              display "no"
           end-if
                
     
                                    
            moving space to a numeric field will initialize it with zeroes (compiler message: COBCH1026E Source literal is non-numeric - substituting zero). A numeric test is succesfull (which causes consequential error). Is there a directive to avoid this - I didn't find any.
thanks in advance
Harald
Thank you for your quickly reply, Chris
                
     
                                    
            moving space to a numeric field will initialize it with zeroes (compiler message: COBCH1026E Source literal is non-numeric - substituting zero). A numeric test is succesfull (which causes consequential error). Is there a directive to avoid this - I didn't find any.
thanks in advance
Harald
  is there any compiler directive to generate an error when I try to move an alphanumeric field to a numeric field?
We want to prevent all those RTS163 pass to runtime.
Thanks.