![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS Companion for the CMS Environment |
| Using the INFILE Statement |
This section provides a brief overview of INFILE statement syntax. For complete information about the INFILE statement, see INFILE.
The form of the INFILE statement is
| INFILE file-specification <options-list>; |
| Form | Example | |
|---|---|---|
| fileref |
indata |
|
| fileref(member) |
maclib(mem1) |
|
| fileref(filename filetype) |
mydir(myfile in) |
|
| filename filetype filemode (or SFS directory) |
'myfile in b' |
|
| filename filetype |
'myfile in' |
|
| CMS pipeline |
< myfile in b |
|
| reserved fileref |
CARDS |
|
You can use these options to do the following:
See INFILE
for valid option values under CMS. For information about other options that
you can specify in the INFILE statement, see
SAS Language Reference: Dictionary.
data read; x='mydata march a'; y='mylib names b'; infile a filevar=x; input Q1 $1. Q2 $1.; infile in filevar=y; input name $20.; run;
| Using the %INCLUDE Statement |
| %INCLUDE file-specification </options-list>; |
The file-specification argument is in one of the forms given in Identifying an External File . For information about the available options, see SAS Language Reference: Dictionary. For example, suppose you issue the following FILENAME statement:
filename mypgm 'saspgm tastest c';
%include mypgm;
You can also use the %INCLUDE statement in interactive line mode to recall previously entered statements, or in noninteractive mode to allow input from the terminal. See %INCLUDE and SAS Language Reference: Dictionary for more information about the %INCLUDE statement.
Aggregate external files can be specified in a %INCLUDE statement as well:
filename mydir 'a'; . . %include mydir(saspgm);As shown in the previous example, the filetype can be left out of %INCLUDE specifications of aggregate SFS directories and minidisks. For aggregates other than CMS MACLIBs, an unspecified filetype defaults to SAS. The previous example copies in and executes the file SASPGM SAS A.
| Using the INCLUDE Command |
The INCLUDE command enables you to display an entire external file in a window.
The form of the INCLUDE command is
| INCLUDEfile-specification<options-list> |
The file-specification argument is in one of the forms given in Identifying an External File . For information about the available options, see in SAS Language Reference: Dictionary. For example, suppose you specify this FILENAME statement:
filename sasfile tape 'tap3';The following command-line command includes the file in the Program Editor window:
include sasfile
When you specify a minidisk or SFS directory as an external aggregate
file with the INCLUDE command you can leave off the filetype, which will default
to
SAS.
See in SAS Language Reference: Dictionary for more information about the INCLUDE command.
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.