 |
The Question is:
Indexed VMSmail distribution list in COBOL
$ MAIL/SUBJ="whatever" file-name @foo.dis
where foo.dis is an indexed, variable-length,
carriage-return-carriage-control file - this works just fine in DCL.
Putting this same command in COBOL and calling LIB$SPAWN to execute it
generates the message
"%DCL-W-SKPDAT, image data (records not beginning with "$") ignored"
When I change the distribution list to a non-indexed file, the COBOL version
works fine.
How can I make this indexed distribution list file work from within COBOL?
Thanks for any help.
The Answer is :
The best approach here is to use the documented and supported callable
MAIL application programming interface (API). Not lib$spawn. Examples
are available for calling the MAIL API from various languages.
That said, the OpenVMS Wizard suspects that the indexed file, the use
of COBOL, and the LIB$SPAWN are all unrelated -- this error can be
readily recreated using DCL, and involves the expected processing around
the DCL "@" command. When at the front of a command, "@" is assumed to
invoke a command procedure. When used in the middle of a command, it
can be used to read command parameters in from a file. (Both of these
uses are documented.)
Here is an example of triggering the error:
$ create tmp.dis
A::y
B::y
$ mail/subject=test nla0: @tmp.dis
New mail on node A:: from X::wizard
%DCL-W-SKPDAT, image data (records not beginning with "$") ignored
The following DCL command procedure works as you apparently expected,
without triggering the SKPDAT error:
$ mail/subject=test nla0: "@tmp.dis"
New mail on node A:: from X::wizard
New mail on node B:: from X::wizard
$
Within your COBOL program, you will (obviously) want to quote the name
of the distribution list. (Or, preferably, migrate to the use of the
callable MAIL API.)
 |
|
|
 |
|