Functions and CALL Routines under OpenVMS |
Category: | External Files |
OpenVMS specifics: | Valid values for filename, device-type, host-options, and dir-ref |
See: | FILENAME Function in SAS Language Reference: Dictionary |
Syntax | |
Details | |
See Also |
Syntax |
FILENAME(fileref, filename<, device-type<,host-options<,dir-ref>>>) |
specifies the fileref to assign to the external file. In a DATA step, fileref can be a character expression, a string enclosed in quotation marks that specifies the fileref, or a DATA step variable whose value contains the fileref. In a macro (for example, %SYSFUNC), fileref is the name of a macro variable (without an ampersand) whose value contains the fileref to assign to the external file. (For details, see the FILENAME function in SAS Language Reference: Dictionary.)
specifies the external file. Specifying a blank filename (' ') deassigns the fileref that was previously assigned.
Under OpenVMS, the filename must be a valid OpenVMS pathname to the external file that you want to use. You can specify the version number of the file, for example, myfile.dat;1 .
specifies the type of device or the access method that is used if the SAS fileref points to an input or output device or location that is not a physical file:
specifies an OpenVMS command. For more information, see Reading from and Writing to OpenVMS Commands (Pipes).
specifies a temporary file that can be accessed only through the logical name and is available only while the logical name exists. If a physical pathname is specified, an error is returned. Files manipulated by the TEMP device can have the same attributes and behave identically to DISK files.
specifies how many disk blocks to allocate to a new external file. The value can range from 0 to 2,147,483,647. If the value is 0 (the default), the minimum number of blocks required for the given file format is used.
tells SAS what type of carriage control to use when it writes to external files. Values for the CC= option are
FORTRAN |
indicates FORTRAN carriage-control format. This is the default for print files. |
CR |
indicates OpenVMS carriage-return carriage-control format. This is the default for nonprinting files. |
tells OpenVMS how many disk blocks to add when it automatically extends an external file during a write operation. The value can range from 0 to 65,535. The default value is 0, telling OpenVMS RMS to use the process's default value.
overrides the default file access attributes used for external files. Values for the FAC= option are
DEL | |
GET | |
PUT | |
UPD |
specifies the file format of graphic stream files (GSF files). The accepted values are
specifies which key SAS uses to read the records in an RMS file with indexed organization. The KEY= option is always used with the KEYVALUE= option.
specifies the key value with which to begin reading an indexed file.
specifies the record length of the output file. If you do not specify a record length, the default is the value of the LRECL= system option. For the input file, the existing record length is used by default. If the LRECL= option is used, the input records are padded or truncated to the specified length.
Range: | 14-32,767 |
See also: | Maximum LRECL Values for File Types |
specifies the size of the I/O buffers that OpenVMS RMS allocates for a particular file. The value can range from 0 to 127 and represents the number of blocks used for each buffer. By default, this option is set to 0 and the default values for the process are used.
specifies the number of I/O buffers you want OpenVMS RMS to allocate for a particular file. The value can range from 0 to 255 and represents the number of buffers used. By default, this option is set to 2. If a value of 0 is specified, the default value for the process is used.
opens the file referenced for append. This option does not take a value.
opens a new file for output. This option does not take a value.
opens a new file for output. This option does not take a value.
specifies the record format of the output file. Values for the RECFM= option are
overrides the default file-sharing attributes used for external files. Values for the SHR= option are
DEL | |
GET | |
NONE | |
PUT | |
UPD |
specifies the fileref that is assigned to the directory in which the external file resides.
Details |
FILENAME returns 0 if the operation was successful, and a non-zero number if it was not successful.
Under OpenVMS, you can assign SAS filerefs using two methods. You can use the DCL DEFINE command to assign a fileref before you invoke SAS. For example:
$ define myfile a.txt $ sas; data; file myfile; put "HELLO"; run;
This creates the file A.TXT.
You can use the X command to assign a fileref during your SAS session.
See Also |
LRECL= System Option in SAS Language Reference: Dictionary
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.