Sample MIME attachment of a GIF file: 1) Create a GIF file with SAS 2) Convert the GIF file to base64 encoding 3) Send the note to another host You will need to: - Change "ibmuser" to your userid - Verify the SAS dataset names at your shop - Change the Mail sending and receiving stuff //PROCLIB JCLLIB ORDER=(SAS609.TS450.PROCLIB) //* //** Create a new library for the SAS GIF file //* //DELIT EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE 'ibmuser.SPFTEMP2.GIF' //* //** Create a new library for the SAS GIF file //* //NEWONE EXEC PGM=IEFBR14 //SYSUT2 DD DSN=ibmuser.SPFTEMP2.GIF, // DISP=(,CATLG),UNIT=SYSDA, // DCB=(LRECL=32756,BLKSIZE=32760,RECFM=VB), // SPACE=(CYL,(1,1,8)) //* //** Invoke SAS to write out a GIF file of the Map of Texas //* // EXEC SAS609 //MAPS DD DISP=SHR,DSN=SYS3.SYS.SAS.MAPS //SYSIN DD * /* | Ensure we have a transparent gif device around */ libname gdevice0 'ibmuser.sas.data'; proc gdevice catalog=gdevice0.devices nofs; copy gif from=sashelp.devices newname=giftrans; mod giftrans ucc='01'x description='GIF with Transparency'; list giftrans; end; /* | The IMGSIZE macro lets you modify the size of the image area | in pixel units. | | Notes: | 1. The dots per inch value (dpi) should be the same as | that used by the driver (dpi=xpixels/xmax). | | 2. The maximum width and height values specified as | parameters should not exceed the xmax and ymax values | of the device used. The default values used below | are arbitrary. */ %macro IMGSIZE(w=1280, h=1024, dpi=95, rows=43, cols=83); %if &dpi<=0 %then %put DPI must be greater than zero.; %else %do; goptions hsize=%sysevalf(&w/&dpi)in vsize=%sysevalf(&h/&dpi)in hpos=&cols vpos=&rows; %end; %mend IMGSIZE; filename out 'ibmuser.spftemp2.gif(texast)'; goptions dev=giftrans gsfname=out gsfmode=replace; %imgsize(w=300, h=200, dpi=95, rows=30, cols=50); data loc; input st $ 1-2 loc; state=stfips(st); cards; TX 40 ; data refiv; set maps.states; if state=stfips('TX'); proc gproject data=refiv out=refiv; id state; proc gmap data=loc map =refiv; choro loc/levels=4; id state; pattern1 v=mempty c=green; title .h=2 .c=blue .f=complex T E X A S; footnote .h=2 .c=red .f=simplex The Lone Star State; /* //* //** Convert the GIF file into BASE64 //* //B64 EXEC PGM=IRXJCL, // PARM='ENBASE64' //SYSEXEC DD DISP=SHR,DSN=ibmuser.DAVE.EXEC <- Where ENBASE64 exec is //* //SYSUT1 DD DISP=SHR,DSN=ibmuser.SPFTEMP2.GIF(TEXAST) //SYSUT2 DD DSN=&&BASE64, // DISP=(,PASS),UNIT=SYSDA, // DCB=(LRECL=80,BLKSIZE=8800,RECFM=FB), // SPACE=(CYL,(5,0),RLSE) //SYSTSIN DD DUMMY //SYSTSPRT DD SYSOUT=* //* //** Send the mail item //* //SENDMAIL EXEC PGM=IEBGENER //SYSIN DD DUMMY //SYSPRINT DD SYSOUT=* //SYSUT2 DD SYSOUT=(B,SMTP) //SYSUT1 DD * helo MVSHOST mail from: rcpt to: data Date: 18 FEB 1998 12:28:00 LCL From: ibmuser@csw.com To: Bozo the Clown Subject: Test message from MVS with attached GIF file Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="---- =_NextPart_000_01BD3BAF.A762FD80" This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------ =_NextPart_000_01BD3BAF.A762FD80 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This email came DIRECTLY from a MVS system and has a MIME attached GIF file. The GIF file and this EMAIL were created in a batch job. ------ =_NextPart_000_01BD3BAF.A762FD80 Content-Type: application/octet-stream; name="TEXAS.GIF" Content-Transfer-Encoding: base64 /* // DD DISP=(OLD,PASS),DSN=&&BASE64 // DD * ------ =_NextPart_000_01BD3BAF.A762FD80-- /*