From: Jack Hamilton on
I would like to use the NOTESDB file interface to Lotus Notes in SAS for
Windows to create email. I have not found any examples that write
email, and I have not been able to get it to work.

Here's what I have (&MSVR and &NUID are set to appropriate values):

=====
filename notes notesdb;

data _null_;

file notes;

put "!NSF_SERVER!&MSVR.";
put "!NSF_DB!mail\&NUID..nsf";

put "!NSF_FIELD!Subject!Test subject";
put '!NSF_FIELD!From!MIA AIS Membership';
put '!NSF_FIELD!SendTo!Jack Hamilton,';

put "!NSF_FIELD!Body!Some text.";
put "!NSF_FIELD!Body!Some more text.";

put '!NSF_ADD!';
putlog "Message added.";
put '!NSF_CLR_FIELDS!';
put '!NSF_CLR_ATTACHES!';

/* All done with this message! */
put '!NSF_ABORT!';

run;

filename notes clear;
=====

The log shows:

=====
NOTE: The file NOTES is:
Lotus Notes (tm) Access Device

New document populated in mail\c449630.nsf Notes database
Message added.
NOTE: 11 records were written to the file NOTES.
The minimum record length was 9.
The maximum record length was 35.
=====

That creates a message in my Drafts folder (which is where I want it to
be), but the two lines of text are wrapped together as

Some text.Some more text.

I want to have paragraphs and embedded links, not just one long blob of
continuous text. I tried putting in the RTF that Notes creates, but
that fails with

=====
ERROR: Document has invalid structure.
FATAL: Unrecoverable I/O error detected in the execution of the data
step program.
Aborted during the EXECUTION phase.
ERROR: Document has invalid structure.
=====

As does any RTF that I try to construct myself or with WordPad.

Has anyone gotten this to work with Mail databases?




--
Jack Hamilton
Sacramento, California
jfh(a)alumni.stanford.org <== Use this, not jfh @ stanfordalumni.org

Tots units fem for�a!