Skip to main content

Problem:

Is there a way to force entry fields in upper case in the Screen Section ?

Something like the UPPER clause of the ACCEPT statement.

Resolution:

There is a call to ADIS (x'AF') that can be used to force lower case characters to be converted to upper case.

       Program-ID. upcase.

       Data Division.

       Working-Storage Section.

       01  Ws-Title                        pic x(50).

       01  Ws-Field-1                      pic x(10).

       01 set-bit-pairs                    pic 9(2) comp-x value 1.

       01 parameter-block.

          03 bit-pair-setting              pic 9(2) comp-x.

          03 bit-map-section               pic x value "2".

          03 bit-pair-number               pic 9(2) comp-x.

          03 filler                        pic 9(2) comp-x value 1.

       Screen Section.

       01  Screen-1.

           05 line 8  col 5  pic x(50) from  Ws-Title.

           05 line 10 col 5            value "Enter Value: <".

           05 line 10 col 19 pic x(10) using Ws-Field-1.

           05 line 10 col 29           value ">".

           05 line 12 col 5            value "Press <ENTER> when done.".

       Procedure Division.

           move "Lower Case entry allowed" to Ws-Title.

           move spaces to Ws-Field-1

           display Screen-1.

           accept  Screen-1.

      *    Modify ADIS to convert Lower-Case input to Upper-Case

           move 85 to bit-pair-number.

           move 1 to bit-pair-setting.

           call x"AF" using set-bit-pairs

                            parameter-block.

           move "Forcing Upper Case entry" to Ws-Title.

           move spaces to Ws-Field-1.

           display Screen-1.

           accept  Screen-1.

Old KB# 2117