Created On:  10 December 2010

Problem:

Is it possible to obtain the Decimal Code of any ASCII character?

Resolution:

This simple COBOL program shows how to do it.

       identification division.
       program-id. ASCII-TO-DEC.
       remarks.      
       environment division.
       special-names.
           decimal-point is comma.
       input-output section.
       file-control.
       data division.
       file section.
       working-storage section.
       01 ASCII-VALUE                      pic x(1).
       01 DEC-VALUE REDEFINES ASCII-VALUE  pic 9(1) COMP-X.      
      
       procedure division.
       main-logic.
          
           MOVE "}" TO ASCII-VALUE
                
           DISPLAY MESSAGE BOX DEC-VALUE   
          
           goback.
Incident #2488768