[Info-vax] Learning VMS application programming
Stephen Hoffman
seaohveh at hoffmanlabs.invalid
Sat Sep 6 20:39:10 EDT 2014
On 2014-09-06 22:28:08 +0000, JF Mezei said:
> A couple of comments:
A couple more comments, on the comments...
> ...
> There are a few subtilities. To exit a program "cleanly" in C, you
> exit(1) (exit code of 1 is "success").
If the OP is not inclined to embed magic numeric constants, then...
exit( EXIT_SUCCESS )
or
exit( SS$_NORMAL )
depending on what the OP is doing, and how portable the OP wants or
needs the C code to be.
Now as for where JF is going with this comment, the native VMS
condition status values use an architectred format, and are completely
different from what you're used to with Unix. Completely different.
The last return statement or the exit() will return the status to DCL.
Failing status codes can abort subsequent processing in a DCL
procedure, which is again different than the default behavior of a Unix
shell script. See the Programming Concepts manual.
> If you need to have 2 processes talk to each other, there are many ways.
Some of the different options: <http://labs.hoffmanlabs.com/node/1198>
> The easiest is to use a mailbox device.
>
> SYS$CREMBX , followed by SYS$ASSIGN followed by SYS$QIO to do IOs and
> SYS$DASSGN
Definitions of "easy" vary, and the OP will generally want to use two
mailboxes here — one for each direction — if the OP does decide to use
a platform-specific approach such as this.
Some of the wrinkles <http://labs.hoffmanlabs.com/node/250>
There are mailbox example programs available, too.
<http://www.digiater.nl/openvms/freeware/v80/hoffman_examples//mbxdemo.c>
I'd probably not start out with mailboxes here, though. If the OP
is used to C and Unix, then sockets and pipes can work fine, and will
look mostly-familiar.
Mailboxes are sorta-kinda a poor work-around for the lack of named
pipes support on VMS.
> (help system <name of service) gets you some documentationl or get the
> full doc at the manual on system services.
I would generally recommend against the help file on VMS, as that's a
problem to navigate, and it's always been intended as a reminder and
not complete documentation. Put another way, HELP is a bit of a pit on
VMS; weaker than man pages in many ways, and weaker than info. See the
Programming Concepts for an overview, then see the system service
reference.
> For process 2 to know what mailbox device was create by process 1,
> process 1 might create it with a "goup" logical name which becomes
> visible to process 2 if it is in the same IIC group (thing user groups
> in unix).
For an experienced Unix programmer (and when working with C), sockets
or pipes are probably easier.
> Once you know what system services you need to use, the documentation is
> very complete. There is/was a introduction to VMS programming which
> provided a whole lot of details on the various services offered by the
> opetating system.
That would be the Programming Concepts manual.
<http://www.hp.com/go/openvms/doc>
ps...
For some of the local examples, look in SYS$EXAMPLES: — these are the
VMS-installed examples.
If there are other example directories around, these are usually
visible with the command:
SHOW LOGICAL *EXAMPLES
Bash DCL command comparison <http://labs.hoffmanlabs.com/node/741>
--
Pure Personal Opinion | HoffmanLabs LLC
More information about the Info-vax
mailing list