Chapter Contents |
Previous |
Next |
FILENAME |
Valid: | anywhere |
CMS specifics: | fileref, device-type, file-specification, options |
Syntax |
FILENAME fileref device-type <'file-specification'> options; |
FILENAME fileref <device-type> 'file-specification' | ('file-specification-1'... 'file-specification-n') options; |
FILENAME fileref 'TAPn'; |
FILENAME fileref PIPE 'pipe-specification'; |
FILENAME fileref | _ALL_ CLEAR; |
FILENAME fileref | _ALL_ LIST; |
FILENAME fileref EMAIL 'address' <email-options>; |
DISK | |
DUMMY | |
PRINTER | |
PUNCH | |
READER | |
TAPE | |
TERMINAL |
Note that you cannot use an asterisk (*) for either filename or filetype.
BLKSIZE= | |
DENSITY= | |
DISP= | |
LABEL= | |
LRECL= | |
RECFM= | |
TRACK= | |
VOLID= |
See Host Option Values for the values that can be assigned to the preceding options. See SAS Language Reference: Dictionary for information on portable options.
ATTACH= | |
CC= | |
EMAILID= | |
EMAILSYS= | |
SUBJECT= | |
TO= | |
TYPE= |
See Electronic Mail Option Values for the FILENAME Statement in the CMS Environment for the values that can be assigned to the preceding options.
The CMS pipeline specification follows the standard syntax for a CMS pipeline; that is it consists of an optional parenthesized list of CMS pipeline options followed by a sequence of one or more stages. The entire specification must be enclosed within a pair of single or double quotes. Comments delimited by /* */ may be contained within the quoted string. These comments are ignored.
For example, this FILENAME statement contains a valid CMS pipeline specification:
filename adata pipe "(name adata) /* name the pipeline */ < archive data a /* read in a file */ | unpack /* unpack if necessary */ ";
For further information, see Using CMS Pipelines .
Details |
See SAS Language Reference: Dictionary for information about portable options and on clearing and listing filerefs.
Tape Device Values |
The following table lists the symbolic names and corresponding virtual addresses for CMS tape output devices.
Symbolic Name | VirtualAddress |
Symbolic Name | VirtualAddress |
|
---|---|---|---|---|
TAP0 | 180 | TAP8 | 288 | |
TAP1 | 181 | TAP9 | 289 | |
TAP2 | 182 | TAPA | 28A | |
TAP3 | 183 | TAPB | 28B | |
TAP4 | 184 | TAPC | 28C | |
TAP5 | 185 | TAPD | 28D | |
TAP6 | 186 | TAPE | 28E | |
TAP7 | 187 | TAPF | 28F |
Host Option Values |
All options use a keyword=value format, and multiple options are separated by blank spaces.
Note that if file specification includes concatenated files, all files must have the same attributes.
Records do not have to be blocked; however, because disk or tape activity is reduced when records are blocked, it is more efficient to use blocks. Blocking records is different when using CMS Native I/O Services than when using OS/MVS Simulation Services.
For CMS Native I/O Services, the following apply:
For MVS Simulated I/O Services, the following apply:
MOD | specifies that output lines are to be written after any existing lines in the file. |
OLD | specifies that any output lines are to be written at the beginning of the file. This is the default. For CMS, this option is identical to the NEW option. |
NEW | specifies that any output lines are to be written at the beginning of the file. For CMS, this option is identical to the OLD option. |
If LABEL=SL, NL, or BLP is specified, an additional label value n can be specified after the SL, NL, or BLP. The value of n indicates the file position in a multifile volume. The default value is 1.
You can choose one of the following record formats:
F | specifies fixed-length records, unblocked. |
FB | specifies fixed-length records, blocked. |
V | specifies variable-length records, unblocked. |
VB | specifies variable-length records, blocked. |
U | specifies undefined-record format. For CMS disk files, this is the same as V. |
You can use the following values in any of the previously listed formats except U.
A | specifies that the first byte of each record is an ANSI printer control character and that the file is to be handled as a print file. |
S | specifies that the file contains spanned records (V), or the file contains standard blocks (F). FS, FBS, VS, and VBS files must be assigned with a CMS FILEDEF command. |
See the FILEDEF command entry in VM/ESA CMS Command Reference, for more information about these options.
For more information about other options available in the FILENAME statement, see SAS Language Reference: Dictionary.
If a variable-length file is opened for update (possibly in the DATA step) and if the replacement line is not the same length as the existing line, the standard CMS file system action truncates the file at that point. No message is given. The next read to that file returns EOF.
Electronic Mail Option Values for the FILENAME Statement in the CMS Environment |
The FILENAME statement supports the following values for email-options, which are used in conjunction with the EMAIL device type to send mail from within a SAS session:
'filename <filetype <filemode | SFS-dir | *>>'
To attach multiple files, use: ('file1' 'file2' ... 'filen'), as shown in the following example:
attach=('june94 txt .reports.june' 'july94 txt .reports.july')
cc='joe@hisaddr.edu' cc=("mark@work.com" "jane@play.org")
To specify a name along with an address, enclose the address in angle brackets (< >):
cc='Joseph Smith <joe@hisaddr.edu>'
Recipients can also be specified as nicknames that will be resolved from the user's NAMES file.
To specify the sender's name and address, include the address in angle brackets (< >), as follows:
emailid='Joseph Smith <joe@hisaddr.edu>'
The following examples show the syntax for a single address and for multiple addresses:
to='joe@hisaddr.edu' to=('joe@hisaddr.edu' 'jane@play.org')
To include a name with an address, enclose the address in angle brackets (< >), as shown in the following example:
to='Joseph Smith <joe@hisaddr.edu>'
Recipients can also be specified as nicknames that will be resolved from the user's NAMES file.
Device Types for the FILENAME Statement in the CMS Environment |
File Characteristics for Devices |
When you specify a device type on an external I/O statement, you can also specify values for file characteristics in the options argument. See Device Types for the FILENAME Statement in the CMS Environment for a list of the options. If you do not specify a value for a file characteristic, a default is used. See the following table, entitled "Default File Characteristics for Devices Other Than DISK" for information on default values. For DISK defaults, see the following table entitled "Default File Characteristics for Disk Files".
Types of Files | LRECL= Option |
RECFM= Option |
BLK-SIZE= Option |
Line Length for Data |
---|---|---|---|---|
Nonprint files: |
||||
DATA step file I/O | 80 | FB | 960 | 80 |
FILE from a window | 136 | V | N/A * | 136 |
Print files: |
||||
LISTING | 257 | VA | N/A | Determined by LINESIZE= system option; 256 maximum |
SASLOG | 257 maximum | VA | N/A | Determined by LINESIZE= system option; 256 maximum |
PRINT (from a window) | Determined by data; 136 maximum | VA | N/A | LRECL- 1 |
*N/A means that the BLKSIZE= option is not applicable for this type of file. |
Device Type | LRECL= Option | RECFM=Option | BLKSIZE=Option | |
---|---|---|---|---|
PUNCH | 80 | FB | 960 | |
READER | 80 | F | 80 | |
TERMINAL | 255 | V | 255 | |
PRINTER | 133 | VA | 137 | |
TAPE | 32760 | U | 32760 | |
TEMP | 80 | FB | 960 | |
DUMMY | 80 | FB | 960 | |
PIPE | n/a | n/a | n/a |
Using the FILENAME Statement When a FILEDEF Command Has Been Issued |
A FILENAME statement reassigns a logical name assignment made by a FILEDEF command, provided that the PERM option is not specified in the FILEDEF command. SAS does not interfere with FILEDEF options that are already specified. Therefore, TAPE options that are specified in the FILE, FILENAME, or INFILE statements that conflict with an existing FILEDEF to TAPE are ignored. See Working with SAS Files on Tape for more information. If the device specified in the FILENAME statement does not result in SAS issuing a FILEDEF command, then it does not matter whether a CMS FILEDEF command with the PERM option has already assigned the fileref.
See Device Types for the FILENAME Statement in the CMS Environment
to determine whether SAS issues a FILEDEF command for a device. Here are
some examples:
Assume the following FILEDEF command is in effect:
FILEDEF MYDATA PUNCH
Then you can issue the following FILENAME statement:
filename mydata punch;
The FILENAME statement associates the virtual PUNCH with the fileref MYDATA. This works because the devices are the same. Now issue the following FILENAME statement:
filename mydata printer;
This FILENAME statement references the virtual printer to the fileref MYDATA. The devices are different, but the PERM option is not in the FILEDEF command. Therefore the FILENAME statement that assigns MYDATA to the printer overrides the FILEDEF command. And, because PRINTER is another device that requires a filedef, a new FILEDEF command is issued.
The following FILENAME statement also reassigns the fileref, this time to the disk file TASTEST DATA *:
filename mydata 'tastest data';
Now, assume that the following FILEDEF command with the PERM option is in effect:
FILEDEF MYDATA PUNCH (PERM
Then you can issue the following FILENAME statement to reference the virtual PUNCH:
filename mydata punch;
Both the FILEDEF command and the FILENAME statement reference the virtual punch.
Now issue the following FILENAME statement:
filename mydata printer;
This statement results in the message that the fileref is not available. The FILEDEF command was issued with the PERM option, and the devices that were referenced by the logical name MYDATA do not match.
Now issue the following FILENAME statement:
filename mydata 'tastest data c';
This FILENAME statement assumes the default device DISK. Notice that device DISK uses the Native CMS Interface. This means that the FILENAME statement does not issue a FILEDEF command. Because a second FILEDEF command to the logical name MYDATA is not issued, the PERM option has no effect. When SAS searches for filerefs, it looks first at those assigned by the FILENAME statement, then at those assigned by the CMS FILEDEF command. So, in this case, instead of associating the fileref MYDATA with the virtual PUNCH, SAS associates it with the DISK file TASTEST DATA C.
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.