Chapter Contents |
Previous |
Next |
FILENAME |
Valid: | anywhere |
OS/390 specifics: | fileref, device-type, physical-filename, host-options |
Syntax |
FILENAME fileref <device-type> file-specification <host-options>; |
FILENAME fileref <device-type> ('file-specification-1'... 'file-specification-n') <host-options>; |
FILENAME fileref | _ALL_ CLEAR; |
FILENAME fileref | _ALL_ LIST; |
You can specify device-type in two ways: either specify it between the fileref and the file specification in the FILENAME statement or use the standard file option UNIT= to specify it. (See Standard File Options for the FILENAME Statement.) If you specify device-type in both ways, the UNIT= option takes priority. If you do not specify a device type or UNIT value for a new file, SAS uses the current value of the SAS system option FILEDEV=.
'myid.raw.datax'
'sas.raw.data(mem1)'
'.raw.data'
'.raw.data(mem1)'
'.raw.data(mem*)'
'.raw.data(*mem1)'
'.raw.data(*)'
'&mytemp'
'/u/userid/raw'or
'HFS:raw'
The value of the FILEEXT= system option can affect the way SAS interprets file specifications for PDS and PDSE files. See FILEEXT= for details.
The value of the FILESYSTEM= system option can also affect the way SAS interprets filenames. See FILESYSTEM= for details.
See Specifying Physical Files for more information about partially qualified data set names.
You can specify these options in any order following 'physical-filename '. When specifying more than one option, use a blank space to separate each option. Values for options may be specified with or without quotes. However, if a value contains one of the supported national characters ($, #, or @), the quotes are required.
Standard File Options for the FILENAME Statement |
Standard file options provide information about a data set's disposition and physical attributes. The following standard options can be used with all external files under OS/390 except for files that are in the Hierarchical File System of UNIX System Services. (See Host-Specific Options for UNIX System Services Files .)
NEW | a new data set is to be created. |
OLD | the data set exists and is not to be shared. |
SHR | the data set exists and may be shared. |
MOD | if the data set exists, new records are to be added to the end; if the data set does not exist, a new data set is to be created. MOD cannot be specified for a partitioned data set. |
The default is SHR.
Note: You can also supply any
of these values for status as a separate, individual keyword in the FILENAME
statement rather than as a subparameter of the DISP= option.
DELETE | deletes the data set at the end of the step. |
KEEP | keeps the data set. |
CATLG | places the entry in the system catalog or user catalog. |
UNCATLG | deletes the entry from the system catalog or user catalog. |
For a new data set, the default is CATLG. For an existing data set, the default is KEEP.
DELETE | indicates that the data set is to be deleted at the end of a job step. |
KEEP | indicates that the data set is to be kept. |
CATLG | indicates that the system should place an entry in the system or user catalog. |
UNCATLG | indicates that the system is to delete the entry in the system or user catalog. |
Here are some examples of the DISP parameter:
DISP=SHR DISP=(NEW,CATLG) DISP=(OLD,UNCATLG,DELETE)
TRK | specifies that the space is to be allocated in tracks. |
CYL | specifies that the space is to be allocated in cylinders. |
blklen | specifies that the space is to be allocated in blocks whose block length is blklen bytes. The system computes how many tracks are allocated. |
CONTIG | means that the allocated space must be contiguous. |
MXIG | means that the maximum contiguous space is required. |
ALX | means that different areas of contiguous space are needed. |
Note: You can also specify MXIG or ALX as
a separate, individual keyword on the FILENAME statement rather than as a
subparameter of the SPACE= option.
Here are some examples of the SPACE parameter:
SPACE=(CYL,10) or SPACE=(CYL,(10,,10),,CONTIG) SPACE=(1024,(100,50,20),RLSE,MXIG,ROUND)
If SPACE is not specified, its values are taken from the SAS system options FILEUNIT=, FILESPPRI=, FILESPSEC=, and FILEDIRBLK=, in the following form:
SPACE=(FILEUNIT,(FILESPPRI, FILESPSEC,FILEDIRBLK))
The default specifications are as follows:
See OS/390 JCL Reference by IBM for complete information about how to use the SPACE= option.
If VOLSER= is not specified, its value is taken from the SAS system option FILEVOL=.
The default for UNIT= is DISK.
label=(3,SL,,,EXPDT=1999/123)
This label specification indicates that the data set sequence number is 3, that it uses standard labels, and that it expires on the 123rd day of 1999. See OS/390 JCL Reference by IBM for complete information about how to use the LABEL= option, including which subparameters you can specify in subparameter-list.
DCB Attribute Options |
The following section
describes
DCB options that can be used in the FILENAME statement. For additional information
about DCB characteristics, see Overview of DCB Attributes.
The following DCB options can be used in the FILENAME statement for all types of external files under OS/390, except for files that are stored in the directory structure of UNIX System Services. (For information about options that are available for UNIX System Services files, see Host-Specific Options for UNIX System Services Files .) These options correspond to the DCB parameters that you would specify in a JCL DD statement.
The values of the FILEBLKSIZE(device-type)= system option contain, for each model of disk that is currently available, the block size that your installation considers best for external, nonprint data sets on that type of disk. Some installations may provide different FILEBLKSIZE default values for batch processing than they do for interactive processing. Therefore, to see the values for the FILEBLKSIZE(device-type)= option, run the OPTIONS procedure both in a batch job and in a SAS session under TSO.
For print data sets, which by default have variable-length records, SAS uses a default block size of 264, with one record per block.
You can use the OPT value of the FILEBLKSIZE(device-type)= option to tell SAS to calculate the optimal block size for nonprint files. (See FILEBLKSIZE(device-type)=.) Or you can calculate the block size yourself:
In each case, if you are writing the data set to disk, compare the block size to the track size for the disk. A block cannot be longer than one track of the disk device on which it is stored, and the operating environment does not split a block between tracks. Make sure that the block size does not leave a large portion of the track unused. (If you are not sure, consult your computing center staff.) See Optimizing I/O for information about determining the optimal block size for your data.
The maximum block size for a data set on tape is 32,760.
The following types of organization, used to refer to physical files that contain location-dependent information, are also valid: DAU, POU, PSU.
You do not need to include the DSORG= value when you create an external file of type PS or PO. This is because the operating environment identifies a partitioned data set by the presence of a directory allocation in the SPACE= parameter. When you use a FILE statement to write data, SAS identifies a PDS or PDSE by the presence of a member name in the FILE statement. If no member name is present, SAS assumes that the data set is sequential.
Logical record length is affected by the record format (see RECFM=). When the record format is fixed (indicated by an F as part of the RECFM= value), all records have the same length, and that length is the value of the LRECL= value.
When the record format is variable (indicated by a V as part of the RECFM= value), records may have different lengths, and each record contains 4 bytes of length information in addition to its other data. Therefore, you must specify an LRECL= value that is 4 bytes longer than the longest record you expect to write. If you do not know the length of the longest record to be put into a variable-format data set, choose a maximum value and add 4 to it to create an LRECL= value.
Valid values are R, J, T, Z, A, Q, F, H, O, C, E, B, U, and W. You can specify more than one code by listing them with no blanks or commas between them (as with RECFM). A maximum of four characters is allowed.
F | fixed length records, unblocked. |
V | variable length records, unblocked. |
FB | fixed length records, blocked. |
VB | variable length records, blocked. |
U | undefined length records, unblocked. |
The following values can be appended to the RECFM= values:
A | specifies that the first byte of each record is an ANSI-printer control character. |
M | specifies that the file is a machine control character file. SAS does not interpret machine-code control characters nor does it create them in output files. See OS/390 JCL Reference by IBM for more information. |
S | specifies that the file contains spanned records (when appended to V), or that the file contains standard blocks (when appended to F). |
The next format stands alone; no other values may be appended.
N | indicates that the file is in binary format. The file is treated as a byte stream; that is, line boundaries are not recognized. This record format is specific to the SAS System. |
DCB attributes are those data set characteristics that describe the organization and format of the data set records. If you do not specify these attributes, the SAS System uses default values for them. This section discusses how and under what circumstances these attributes are changed or default values are used.
The discussion focuses on the RECFM, LRECL, and BLKSIZE file attributes. For more information, see the appropriate data administration guide for your system.
Values for these attributes are kept in each of the following operating environment control blocks:
For existing data sets, DCB attributes are almost always used unchanged from the DSCB. These attributes may be overridden by a DD statement or TSO ALLOCATE command or by SAS FILENAME, FILE, or INFILE options. If an option is specified in both places, the FILENAME, FILE, or INFILE option takes precedence.
When a data set is opened, OS/390 merges information from the DSCB (or data set label) and the JFCB to obtain the current DCB characteristics before entering the DCB open exit. SAS then merges its own information (FILENAME/FILE/INFILE statement options, data set device type, requested data set type, requested line size from LS=) and inspects the resulting DCB attributes. If the result is invalid for some reason, SAS terminates the open operation and issues an appropriate message. Attributes may be considered invalid for any of the following reasons:
For any unspecified attributes, SAS takes default values that seem to fit existing attributes. This may cause unexpected combinations of attributes to be set, so be wary of specifying an incomplete set of attributes for a data set.
If no permanent attributes are present (as is possible with a new data set), and if none are given by FILENAME/FILE/INFILE options, then SAS uses default values that are based on the device type and data set type. The following table summarizes these default values.
Attribute | DISK | TAPE | PRINT/ SYSOUT | TERMINAL | DUMMY | |
---|---|---|---|---|---|---|
RECFM | FB | FB | VBA | V | FB | |
LRECL | 80 | 80 | 260 | 261 | 80 | |
BLKSIZE | * | ** | 264 | 265 | * | |
*The smaller of the SAS
system option FILEBLKSIZE(device-type)= value and the output device maximum, rounded down to
a multiple of the LRECL.
**The smaller of the SAS system option FILEBLKSIZE(device-type)= value and 32,760, rounded down to a multiple of the LRECL. |
If a line size (LS=) parameter is given, SAS uses this value to compute the LRECL, and the BLKSIZE is computed accordingly.
If permanent attributes are overridden on input, these values are used only for the duration of the INFILE processing; the permanent attributes of the data set are not changed. However, if attributes are overridden on output, the specified attributes become permanent for the data set, even if no records are physically written.
Options That Specify SMS Keywords |
The implementation of the DATACLAS= option is compatible with the SMS DATACLAS= JCL parameter. For complete information about this parameter, see OS/390 JCL Reference. Ask your system administrator for the data-class names that are used at your site.
LIBRARY | indicates that the data set is a PDSE. |
PDS | indicates that the data set is a PDS. |
DSNTPE= is valid only for SMS data sets, and is valid only when DSORG=PO.
The implementation of the MGMTCLAS= option is compatible with the SMS MGMTCLAS= JCL parameter. For complete information about this parameter, see OS/390 JCL Reference. Ask your system administrator for the management class names that are used at your site.
KS | VSAM key-sequenced data set |
ES | VSAM entry-sequenced data set |
RR | VSAM relative-record data set |
LS | VSAM linear-space data set |
The implementation of the STORCLAS= option is compatible with the SMS STORCLAS= JCL parameter. For full details on this parameter, refer to OS/390 JCL Reference. See your system administrator for storage class names at your site.
SYSOUT Data Set Options for the FILENAME Statement |
The following options apply to data sets that are sent to a system output device (usually a printer). The default value is usually the value that was specified by your site as the installation default. See Writing to Print Data Sets , as well as your IBM JCL reference, for more information about print data sets.
Subsystem Options for the FILENAME Statement |
Options for UNIX System Services Files and Pipes |
Several options can be specified in the FILENAME statement for files and pipes that are in the Hierarchical File System of UNIX System Services. For information about these options, see Accessing UNIX System Services Files .
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.