CALL "ASCII2OCTAL" USING asciiValue octalValue |
asciiValue | PIC X(2) | Contains the ASCII characters to be converted. If characters outside the ASCII table are passed, results are unpredictable. |
octalValue | PIC 9(8) | Receives the octal value of asciiValue. |
MOVE X"00" TO asciiValue(1:1) MOVE "A" TO asciiValue(2:1) CALL "ASCII2OCTAL" USING asciiValue, octalValue | Returns 101 |
*> asciiValue should be pic x(n) *> octalValue should be pic 9(n) and have double the length of the *> asciiValue move "AZ" to asciiValue call "ascii2octal" using asciiValue octalValue *> octalValue will contain 00040532 |