*
;
/*
        Date: Tue, 11 Feb 1997 21:46:30 +0000
    Reply-To: David Shannon 
      Sender: "SAS(r) Discussion" 
        From: David Shannon 
     Subject: Re: SAS/GRAPH to MS-Word - what is the best way?
    Comments: To: ehoogenb@solair1.inter.nl.net
 In-Reply-To: <32FB9879.3417@solair1.inter.nl.net>

I am certainly familar with this problem!  My solution has been to
export from SAS (GOPTIONS Device=) into a HGL / CGM or other compatible
file format then "INSERT PICTURE" into your Word document.  Takes a bit
of messing I must admit, but the macro I use is below:
______________________________
David Shannon
david@schweiz.demon.co.uk
http://www.schweiz.demon.co.uk

*/
/*___________________________________________________________________
|                                                                    |
|                            PrintG                                  |
|                           ________                                 |
|                                                                    |
| Macro to setup device parameters for writing to file or hard       |
| printing.                                                          |
|____________________________________________________________________|
|            |         |                                             |
| Parameter  | Default | Description                                 |
|____________|_________|_____________________________________________|
|            |         |                                             |
| To         | W       | OPTIONAL: Sends output to the file          |
|            |         | graph.gsf or if you give P it sends output  |
|            |         | to the printer, or F sends to a file.       |
|            |         |                                             |
| O          | L       | OPTIONAL: Sets printing orientation to      |
|            |         | landscape or if you give P it sets to       |
|            |         | portrait.                                   |
|            |         |                                             |
| N          | 1       | OPTIONAL: Suffix to the output graphic      |
|            |         |           file name.                        |
|            |         |                                             |
| Type       | HGL     | OPTIONAL: Format of graphics file: BMP, CGM,|
|            |         | GIF, HGL, or TIF.                           |
|____________|_________|_____________________________________________|
|                                                                    |
| Usage      : %PrintG;                                              |
|              %Printg(To=W);                                        |
|              %Printg(To=F,Type=TIF);                               |
|                                                                    |
| Note       : Requires the directory structure set within the macro |
|              (or change the macro) and set your own print drivers. |
|                                                                    |
| Written by : David G. Shannon, V1.1, 14/10/95                      |
| References : SAS Graph manual, Vol. 1&2                            |
|__________________________________________________________________*/;


%Macro PrintG(To=W,O=L,Type=HGL,N=1);

       %If %Upcase(&To)=F %Then
           %Do;
               %If %Upcase(&type)=BMP %Then %Let D=BITMAP;
               %If %Upcase(&type)=CGM %Then %Let D=CGM;
               %If %Upcase(&type)=GIF %Then %Let D=GIFF;
               %If %Upcase(&type)=TIF %Then %Let D=TIFF;
               %If %Upcase(&type)=HGL %Then %Let D=HPGL;
           %End;
       %If %Upcase(&To)=W %Then
           %Do;
               %Let d=WIN;
           %End;
       %If %Upcase(&To)=P %Then
           %Do;
               %If %Upcase(&O)=L %Then %Let D= %* Your printer driver;
               %If %Upcase(&O)=P %Then %Let D= %* Your printer driver;
           %End;

       Goptions RESET=ALL
                CBack=White
                GUnit=CM
                HText=0.3cm
                FText=Swissl
                device=&D
                %If %Upcase(&to)=F %Then
                    %Do;
                         Gaccess="sasgastd>c:\allwork\graph&N..&type"
                         Gsfmode=replace;
                    %End;;

       %If %UPCase(&To)=F %Then
       %Do;
       %PUT; %PUT   NOTE:  IF GRAPH WRITTEN SUCCESSFULLY,;
             %PUT   NOTE:  IT WAS WRITTEN TO: Graph%eval(&N).&TYPE;%PUT;
       %End;

%Mend PrintG;

*
;