Page 1 of 1

filler character

PostPosted: Thu Nov 29, 2012 5:37 pm
by msbaujs
In a map I defined an array as MYL'_' for the presentation and a control Variable cv(*)
Sometimes i put move (AD=p) to CV (6:10) for avoiding data Entry , and i want also that the filler character will presented as empty and not with the '_? character

Can i do it?

Re: filler character

PostPosted: Fri Nov 30, 2012 5:28 am
by RGZbrog
This was tested under Natural for Windows. You'll have to see how it fares on the mainframe.
DEFINE DATA LOCAL
1 #A (A5)   INIT <'ab'>
1 #B (A5)
1 #C (C)
1 #L (L)    INIT <TRUE>
END-DEFINE
REPEAT
  INPUT (AD=MDL'_')
        'A:' #A (CV=#C)
     // 'B:' #B
  IF  #L
    THEN
      RESET #L
      IF  #A = ' '
        THEN
          ASSIGN #C = (AD=PN)
        ELSE
          ASSIGN #C = (AD=P)
          COMPRESS #A
                   H'0000000000'
              INTO #A LEAVING NO SPACE
      END-IF
    ELSE
      ASSIGN #L = TRUE
      ASSIGN #C = (AD=D)
      EXAMINE #A FOR H'00' DELETE
  END-IF
END-REPEAT
END

If the field is empty, the CV is set to non-display (AD=N). Otherwise the filler is replace with non-displayable characters (H'00'). For display (ie to revert to underscores) the hex zeros are deleted.

This works for alpha fields; I haven't come up with a solution for numerics, yet.

Re: filler character

PostPosted: Fri Nov 30, 2012 5:20 pm
by msbaujs
thank you , its work