To enable the snapshot module PASSNAP to show variables from modules, too, it is necessary to open files using CMS FILEDEF commands which are issued at runtime (command built from Pascal variables).
I recall that at the Stuttgart University installation in 1984 and 1985 (a 4331 and a 3083 running VM/CMS), there was an external subroutine called CMSX, which could be called from Pascal VS (see documentation) and could call CMS commands.
So I analyzed some programs which I found on the PLI minidisk of the Hercules VM distribution and looked how a CMS command can be called. In fact, this turned out to be pretty simple; the CMS command has to be "tokenized" and then the SVC 202 (X'CA') has to be called.
I did the tokenization in Pascal, put the routine CMSX in the library module PASSTRX (where we have MEMSET and MEMCPY already) and called the ASSEMBLER function $PASSYS in PASMONN to do the SVC call. BTW: $PASSYS was called $PASSTOR before; it did the basic GETMAINs and FREEMAINs for the ALLOC and FREE function, but it was better to rename it to $PASSYS, because it does all kind of system related stuff, not only storage management.
This is the CMSX procedure in PASSTRX:
|
and here are some CMSX sample calls (the commands must be terminated by '#' or CHR (0)):
|