SAS GRAPH output as pdf file

SAS GRAPH output as pdf file

Post by Sharon Ry » Sun, 12 Jan 2003 04:04:02



Hi all,
  I'm trying to create a SAS graph as a pdf file and be able to name
it. My code below creates a file named 'testd.pdf' but the file won't
open properly in Acrobat.   If I exclude the 'gsfname=out'  option, it
produces a good pdf file named 'sasgraph.pdf'.   What do I need to do
to get a valid pdf file with a name I choose?

   All help appreciated.

---------------------------------------

filename out "testd.pdf";  /* without gsfname=out below, it produces a
valid 'sasgraph.pdf' file */

 goptions reset=all
          device=pdf
          rotate=landscape
          csymbol=black
          ctext=black
          cback=white
          htext= 1.0
          gsfmode=replace

          gsfname=out ;  /* using this gsfname statement creates a
file
                            named 'testd.pdf',        
                            but it won't open properly */

          symbol1 interpol=join value=dot      h=1 w=2    color=black;
          symbol2 interpol=join value=square   h=1 w=2    color=black;

  data test;
      do i=1 to 5;
        x=i;
        y=i+2;
        z=y+2;
        output;
      end;

   proc gplot ;
     plot  x*y='*' x*z='-'/overlay;
     title 'test graphic output';
    run;

 quit;

 
 
 

SAS GRAPH output as pdf file

Post by Rodney Sparapan » Sun, 12 Jan 2003 04:22:25


Sharon:

Try this:

Quote:> filename gsasfile "testd.pdf";  
> goptions reset=all
>          device=pdf
>          rotate=landscape
>          csymbol=black
>          ctext=black
>          cback=white
>          htext= 1.0
>          gsfmode=replace
>          gaccess=gsasfile;

--
Rodney Sparapani              Medical College of Wisconsin
Sr. Biostatistician           Patient Care & Outcomes Research

Was 'Name That Tune' rigged?  WWLD -- What Would Lombardi Do

 
 
 

SAS GRAPH output as pdf file

Post by Pete Lu » Sun, 12 Jan 2003 04:36:30


Hi Sharon-
  I'd use ODS PDF to create the file.  Try this:

/***************************************************************************
***************/

ods pdf file= "c:\temp\testd.pdf";

 goptions reset=all
          device=gif
          rotate=landscape
          csymbol=black
          ctext=black
          cback=white
          htext= 1.0 ;

          symbol1 interpol=join value=dot      h=1 w=2    color=black;
          symbol2 interpol=join value=square   h=1 w=2    color=black;

  data test;
      do i=1 to 5;
        x=i;
        y=i+2;
        z=y+2;
        output;
      end;

   proc gplot ;
     plot  x*y='*' x*z='-'/overlay;
     title 'test graphic output';
    run;

 quit;

 ods pdf close;

/***************************************************************************
***************/

By the way - the code you supplied works as is in V9, but I get the same
error as you do in V8.2.

----------------------------------------------------------------------------
---
Pete Lund
Northwest Crime and Social Research, Inc.
A SAS Alliance Partner
215 Legion Way SW
Olympia, WA   98501
(360) 528-8970  - voice
(360) 280-4892  - cell
(360) 570-7533  - fax

www.nwcsr.com
----------------------------------------------------------------------------
---

-----Original Message-----

Sharon Ryan
Sent: Friday, January 10, 2003 11:04 AM

Subject: SAS GRAPH output as pdf file

Hi all,
  I'm trying to create a SAS graph as a pdf file and be able to name
it. My code below creates a file named 'testd.pdf' but the file won't
open properly in Acrobat.   If I exclude the 'gsfname=out'  option, it
produces a good pdf file named 'sasgraph.pdf'.   What do I need to do
to get a valid pdf file with a name I choose?

   All help appreciated.

---------------------------------------

filename out "testd.pdf";  /* without gsfname=out below, it produces a
valid 'sasgraph.pdf' file */

 goptions reset=all
          device=pdf
          rotate=landscape
          csymbol=black
          ctext=black
          cback=white
          htext= 1.0
          gsfmode=replace

          gsfname=out ;  /* using this gsfname statement creates a
file
                            named 'testd.pdf',
                            but it won't open properly */

          symbol1 interpol=join value=dot      h=1 w=2    color=black;
          symbol2 interpol=join value=square   h=1 w=2    color=black;

  data test;
      do i=1 to 5;
        x=i;
        y=i+2;
        z=y+2;
        output;
      end;

   proc gplot ;
     plot  x*y='*' x*z='-'/overlay;
     title 'test graphic output';
    run;

 quit;

 
 
 

SAS GRAPH output as pdf file

Post by Huang, » Sun, 12 Jan 2003 04:46:40


After I added ftext=hwpdf002 in the goptions statement,
the file is fine. You can try hwpdf003 etc.

Good luck.

Ya

-----Original Message-----

Sent: Friday, January 10, 2003 11:04 AM

Subject: SAS GRAPH output as pdf file

Hi all,
  I'm trying to create a SAS graph as a pdf file and be able to name
it. My code below creates a file named 'testd.pdf' but the file won't
open properly in Acrobat.   If I exclude the 'gsfname=out'  option, it
produces a good pdf file named 'sasgraph.pdf'.   What do I need to do
to get a valid pdf file with a name I choose?

   All help appreciated.

---------------------------------------

filename out "testd.pdf";  /* without gsfname=out below, it produces a
valid 'sasgraph.pdf' file */

 goptions reset=all
          device=pdf
          rotate=landscape
          csymbol=black
          ctext=black
          cback=white
          htext= 1.0
          gsfmode=replace

          gsfname=out ;  /* using this gsfname statement creates a
file
                            named 'testd.pdf',
                            but it won't open properly */

          symbol1 interpol=join value=dot      h=1 w=2    color=black;
          symbol2 interpol=join value=square   h=1 w=2    color=black;

  data test;
      do i=1 to 5;
        x=i;
        y=i+2;
        z=y+2;
        output;
      end;

   proc gplot ;
     plot  x*y='*' x*z='-'/overlay;
     title 'test graphic output';
    run;

 quit;

 
 
 

1. SAS/Graph: enabling portrait legal-size output in the graph output window

Hi All,

I'm using the following code to generate a gplot in the SAS/Graph output
window:

goptions reset=all  gunit=in
         ftext="Arial" htext=0.15 ftitle="Arial" htitle=0.15 ;

axis1 length=6    value=(height=0.1 rotate=0) ;
axis2 length=7.6  value=(height=0.1 rotate=0) ;

symbol  font="Wingdings" value=l height=0.1 color=blue ;

proc gplot data = a ;
   plot pt*coll_date / haxis=axis1 vaxis=axis2 ;
run ;

When I try to increase the "axis2 length=" specification to anything
greater than 7.6 in, I get a notification that the value can't exceed 7.6
in.  What can I do to enable proc gplot output to fill a legal size area
(say vaxis x haxis = 12 in x 6 in) in the SAS/Graph output window?  After
manually reviewing the graph in the SAS/Graph output window, I will be
using the "File -> Export-as" to save the output to emf format.

Thanks for any insights.

-Bill

2. Adobe gamma loader parameters

3. SAS/GRAPH output to PDF - damaged file

4. Custom Theme problem

5. SAS/GRAPH: Convert .gsf graph files to PDF or Postscript

6. Needing help: LX EXE file format

7. SAS/Graph output to PDF and RTF

8. Problem with verbatim environment

9. SAS/GRAPH output - CGM or PDF?

10. SAS/GRAPH output to multiple output destinations - findings

11. SAS/GRAPH output to multiple output destinations

12. PDF file created by SAS/GRAPH

13. How to create Pdf file for normal SAS output