How SAS/GRAPH Generates Initial GRSEG Names and Filenames summarizes
how SAS/GRAPH generates
names for catalog entries and graphics output files, depending on
1) whether the NAME= option is used, and 2) the file reference specification
in the FILENAME statement. This illustration assumes that the GCHART
procedure is used with the DEVICE=GIF graphics option. It describes
the case where a GRSEG and output file of the same name do not already
exist, and the case where they do already exist.
How SAS/GRAPH Generates Initial GRSEG Names and Filenames
|
|
|
|
GSFNAME= points to a
file named "MYGRAPH.GIF" and the catalog is empty.
|
external filename: MYGRAPH.GIF
|
|
GSFNAME= points to an
aggregate file storage location and the catalog is empty.
|
external filename: FRED.GIF
|
|
The NAME= value is exactly
eight characters in length. GSFNAME= points to an aggregate file storage
location and the catalog is empty.
|
external filename:MYIMAGES.GIF
|
|
GSFNAME= points to an
aggregate file storage location and the catalog is empty.
|
external filename: WEATHEROBS.GIF
|
|
GSFNAME= points to a
file named "MYGRAPH.GIF" and the catalog is empty.
|
external filename: MYGRAPH.GIF
|
|
GSFNAME= points to an
aggregate file storage location and the catalog is empty.
|
external filename: GCHART.GIF
|
Note: When the file reference points
to an aggregate file storage location, the name of the GRSEG
always determines the name of the graphics output
file. It does not matter whether the GRSEG name is the default name
or a name assigned by the NAME= option.
CAUTION:
If the
graph created by your program already exists in the catalog, a new
GRSEG with an incremented name is created. A new graphics output file
might be created, which leaves your old graphics output file in place.
Although GRSEG names
cannot be more than eight characters in length, the NAME= option supports
long names. When the NAME= option is assigned a name of more than
eight characters and the file reference points to an aggregate file
location, the GRSEG name is the NAME= value truncated to eight characters,
and the graphics output filename is the complete NAME= value. This
is demonstrated by the NAME="WEATHEROBS" example in How SAS/GRAPH Generates Initial GRSEG Names and Filenames.
When a GRSEG of the
same name already exists in the catalog, the
SAS/GRAPH software combines the NAME= option
value with a number to create an incremented name of no more than
eight characters. If the GSFNAME= graphics option is used and the
file reference points to an aggregate file location, the new graphics
output filename is also incremented using the same number that is
used for the GRSEG name. The way in which the incremented graphics
output filename is formed depends on the length of the NAME= value
as follows:
-
If the length of the NAME= value
is less than eight characters or more than eight characters, the number
that is used in the GRSEG name is appended to the NAME= value.
-
If the length of the NAME= value
is exactly eight characters, the number that is used in the GRSEG
name is appended to the first seven characters of the NAME= value.
If the GSFNAME= graphics
option points to a file, the graphics output filename remains the
same and the original file is replaced with the new graph by default.
How SAS/GRAPH Increments GRSEG Names and Filenames
|
|
|
|
GSFNAME= points to a
file named "MYGRAPH.GIF" and GRSEG FRED already exists.
|
external filename: MYGRAPH.GIF
|
|
GSFNAME= points to an
aggregate file storage location and GRSEG FRED already exists.
|
external filename: FRED1.GIF
|
|
The NAME= value is exactly
eight characters in length. GSFNAME= points to an aggregate file storage
location and GRSEG MYIMAGES already exists.
|
external filename:MYIMAGE1.GIF
|
|
GSFNAME= points to an
aggregate file storage location and GRSEG WEATHERO already exists.
|
external filename: WEATHEROBS1.GIF
|
|
GSFNAME= points to a
file named "MYGRAPH.GIF" and GRSEG GCHART already exists.
|
external filename: MYGRAPH.GIF
|
|
GSFNAME= points to an
aggregate file storage location and GRSEGs GCHART and GCHART1 already
exist.
|
external filename: GCHART2.GIF
|
Notice that in the NAME="MYIMAGES"
example the incremented external filename is formed by appending the
number to the first seven characters of the NAME= value, while in
the NAME="WEATHEROBS" and NAME="FRED" examples, the incremented external
filename is formed by appending the number to the full NAME= value. Be
aware that the way in which the incremented graphics output filename
is formed is different when the length of the NAME= value is exactly
eight characters than when it is more or less than eight characters.
You cannot replace individual
GRSEGs in a catalog. To replace a GRSEG, you must delete the GRSEG,
and then re-create it. Therefore, even though the contents of the
graphics output file are replaced, the GRSEG is not. Each time you
submit the program, a new GRSEG is created, and the GRSEG name is
incremented.