• SYS$FAO coding example in BLISS-32

    From David Meyer@21:1/5 to All on Thu Jul 11 22:55:16 2024
    (I posted about this on the VSI forums, but am posting here in case
    there are any old VMS hackers hanging out only here.)

    Does anyone have an code example of calling SYS$FAO in a BLISS program?

    I'm trying to teach myself the language from old manuals and want a way
    to print text and numeric data from programs to my terminal. I've found
    the TUTIO package, but would like to know a method that also works in
    batch mode. SYS$FAO looks like a useful way to format data into
    character strings for output with LIB$PUT_OUTPUT, but I've so far only succeeded in printing blank lines, and can only find coding examples in
    MACRO or FORTRAN.

    --
    David Meyer
    Takarazuka, Japan
    papa@sdf.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jim Duff@21:1/5 to David Meyer on Fri Jul 12 05:43:18 2024
    On 11/7/24 23:55, David Meyer wrote:
    (I posted about this on the VSI forums, but am posting here in case
    there are any old VMS hackers hanging out only here.)

    Does anyone have an code example of calling SYS$FAO in a BLISS program?

    I'm trying to teach myself the language from old manuals and want a way
    to print text and numeric data from programs to my terminal. I've found
    the TUTIO package, but would like to know a method that also works in
    batch mode. SYS$FAO looks like a useful way to format data into
    character strings for output with LIB$PUT_OUTPUT, but I've so far only succeeded in printing blank lines, and can only find coding examples in
    MACRO or FORTRAN.


    Try section 8.3.1 of the the BLISS 32 User Manual?

    https://www.digiater.nl/openvms/freeware/v50/bliss/b32uman.pdf

    Jim
    --
    eight-cubed.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hunter Goatley@21:1/5 to David Meyer on Thu Jul 11 23:30:18 2024
    On 7/11/2024 9:55 AM, David Meyer wrote:
    (I posted about this on the VSI forums, but am posting here in case
    there are any old VMS hackers hanging out only here.)

    Does anyone have an code example of calling SYS$FAO in a BLISS program?

    I'm trying to teach myself the language from old manuals and want a way
    to print text and numeric data from programs to my terminal. I've found
    the TUTIO package, but would like to know a method that also works in
    batch mode. SYS$FAO looks like a useful way to format data into
    character strings for output with LIB$PUT_OUTPUT, but I've so far only succeeded in printing blank lines, and can only find coding examples in
    MACRO or FORTRAN.

    You might take a look at my FREE utility, which displays disk block
    usage summaries for mounted disks.

    https://vms.process.com/scripts/fileserv/fileserv.com?FREE

    It's written in BLISS and calls SYS$FAO (via the $FAO macro). It also
    shows how to call $DEVICE_SCAN, LIB$PUT_OUTPUT, and $GETDVIW. It's a
    much smaller program than my other BLISS packages that call it. This
    isn't going to wrap correctly, but here's some sample output.

    DECUServe$ run free
    Device Name Volume Label Type Used Blocks Free Blocks
    Total
    ---------------- -------------- ------ --------------- --------------- ---------
    DSA0: ALPHASYS DKX00 15325103 (79%) 4206033 (21%)
    19531136
    DSA1: USER1 DKX00 3920423 (21%) 15610713 (79%)
    19531136
    DSA2: USER2 DKX00 11194730 (58%) 8336406 (42%)
    19531136
    [...]

    Totals: 13 mounted disks 328010MB (77%) 101353MB (23%)
    429363MB


    Hunter
    ------
    Hunter Goatley, Process Software, https://www.process.com/ goathunter@goatley.com https://hunter.goatley.com/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Meyer@21:1/5 to Jim Duff on Fri Jul 12 14:17:46 2024
    Jim Duff <jim@bad.invalid> writes:

    Try section 8.3.1 of the the BLISS 32 User Manual?

    https://www.digiater.nl/openvms/freeware/v50/bliss/b32uman.pdf

    Thanks for the pointer. I actually found that example in an older
    edition of the manual a few days ago, but didn't notice the call to
    $FAOL!

    One (or two?) problem trying to compile the example with Compaq COBOL
    V2.7 on Alpha:

    MSGDESC[0] = .RSLT; ! Modify output descriptor
    ...........^
    %BLS32-W-TEXT, Null actual parameter for structure BLOCK has no
    default value
    at line number 29 in file DISK$USER_01:[PAPA]SHOWTIMEUM.B32;2

    MSGDESC[0] = .RSLT; ! Modify output descriptor
    ..............^
    %BLS32-W-TEXT, Fetch or store applied to field of zero size
    at line number 29 in file DISK$USER_01:[PAPA]SHOWTIMEUM.B32;2

    However, changing the flagged line as follows allows the example to
    compile and run as expected:

    MSGDESC [DSC$W_LENGTH] = .RSLT;

    --
    David Meyer
    Takarazuka, Japan
    papa@sdf.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Meyer@21:1/5 to All on Fri Jul 12 15:17:33 2024
    Brain fart. All the old languages are rattling around in my head.

    I meant to write that I compiled the example program with BLISS-32E V1.11-004. --
    David Meyer
    Takarazuka, Japan
    papa@sdf.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hunter Goatley@21:1/5 to David Meyer on Fri Jul 12 08:44:01 2024
    On 7/12/2024 1:17 AM, David Meyer wrote:
    Jim Duff <jim@bad.invalid> writes:

    MSGDESC[0] = .RSLT; ! Modify output descriptor
    ..............^
    %BLS32-W-TEXT, Fetch or store applied to field of zero size
    at line number 29 in file DISK$USER_01:[PAPA]SHOWTIMEUM.B32;2

    However, changing the flagged line as follows allows the example to
    compile and run as expected:

    MSGDESC [DSC$W_LENGTH] = .RSLT;


    In BLISS, structures are referenced by field selectors.

    If you look at the definition of DSC$W_LENGTH in
    SYS$LIBRARY:STARLET.REQ, you'll see that it is:

    macro DSC$W_LENGTH = 0,0,16,0 %; ! A one-word field specifiec to
    the descriptor class;

    The four field selectors are OFFSET, POSITION, WIDTH, SIGN.

    Hunter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)