[Info-vax] COBOL example $MGBLSC

Arne Vajhøj arne at vajhoej.dk
Fri Sep 8 22:18:33 EDT 2023


On 9/8/2023 12:45 PM, Brian Schenkenberger wrote:
> It'd be great too if there was a way to DISPLAY them in HEX

I don't know the right Cobol way to display as hex, but
FAO work in Cobol as well.

identification division.
program-id.hex1.
*
data division.
working-storage section.
01  v       pic 9(9) comp.
01  fmt     pic x(7) value "!SL !XL".
01  buflen  pic 9(9) comp.
01  buf     pic x(100).
*
procedure division.
main-paragraph.
     move 123 to v
     call "LIB$SYS_FAO"
         using
            by descriptor fmt
            by reference buflen
            by descriptor buf
            by value v
            by value v
     end-call
     display buf(1:buflen)
     stop run.

Arne




More information about the Info-vax mailing list