forked from friendly/SAS-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcgm.sas
81 lines (68 loc) · 2.61 KB
/
cgm.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*--------------------------------------------------------------*
* Name: cgm.sas *
* Title: Set graphics parameters for CGM file output *
*--------------------------------------------------------------*
* Author: Michael Friendly <[email protected]> *
* Created: 5 Dec 1996 14:30:47 *
* Revised: 17 Apr 2003 13:59:37 *
* Version: 1.2 *
* Dependencies: *
* sasgfile *
* defined *
*--------------------------------------------------------------*/
/*=
=Description:
=Parameters:
* FN Basename of the graphic file(s). If not specified,
the basename is looked for in the environment variables
SASFILE or GSASFILE.
* DEVICE= Set the default CGM device driver. If not specified,
the macro looks for a global macro variable, DRIVER,
or an ENVIRONMENT variable by the same name. Otrherwise,
the default CGMOF97L driver is used.
* HSIZE= Horizontal size of the CGM output file(s). If not specified,
the maximum hsize for the selected device is used.
* VSIZE= Vertical size of the CGM output file(s). If not specified,
the maximum vsize for the selected device is used.
=Notes:
The default driver=cgmof97L defines a landscape format with
XMAX=11 in, YMAX=8.5 in
Scalable fonts --
HWCGM001 - Helvetica
HWCGM002 - HelveticaBold
HWCGM003 - HelveticaItalic
HWCGM004 - HelveticaBoldItalic
HWGCM005-008 - Times Roman
HWGCM009-012 - Courier
HWCGM013 - Symbol
HWCGM014 - ZapfDingbats
=*/
%global driver fig gsasfile gsasdir devtyp;
%macro cgm(
fn,
device=,
hsize=,
vsize=,
ftext=hwcgm001
);
%*-- Get the basename of the graphic file(s);
%sasgfile(cgm,&fn);
%if %length(&device) %then %do;
%let dev=&device;
%end;
%else %do;
%if not %defined(DRIVER) %then
%let driver =%SYSGET(DRIVER);
%if &driver=%str() %then %let driver = CGMOF97L;
%let dev=&driver;
%end;
%let devtyp = CGM;
%let fig=1;
%if %defined(gsasdir)=0 %then %let gsasdir=;
%put CGM: gsasfile is: "&gsasdir.&gsasfile" (&dev driver);
filename gsasfile "&gsasdir.&gsasfile";
goptions device=&dev gaccess=gsasfile
/* hpos=80 vpos=75 match pscolor device */
gsflen=80 gsfmode=replace;
goptions vsize=&vsize hsize=&hsize ftext=&ftext;
%mend cgm;