Discussion:
SYS$FAO coding example in BLISS-32
(too old to reply)
David Meyer
2024-07-11 13:55:16 UTC
Permalink
(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
***@sdf.org
Jim Duff
2024-07-11 19:43:18 UTC
Permalink
Post by David Meyer
(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
David Meyer
2024-07-12 05:17:46 UTC
Permalink
Post by Jim Duff
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
***@sdf.org
David Meyer
2024-07-12 06:17:33 UTC
Permalink
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
***@sdf.org
Hunter Goatley
2024-07-12 12:44:01 UTC
Permalink
Post by David Meyer
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
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

Hunter Goatley
2024-07-12 03:30:18 UTC
Permalink
Post by David Meyer
(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/
***@goatley.com https://hunter.goatley.com/
Loading...