Chapter Contents |
Previous |
Next |
The DATASOURCE Procedure |
The DATASOURCE procedure uses the following statements:
The PROC DATASOURCE statement is required. All the rest of the statements are optional.
The DATASOURCE procedure uses two kinds of statements:
The subsetting statements are the KEEP, DROP, KEEPEVENT, and DROPEVENT statements (which select output variables); the RANGE statement (which selects time ranges); and the WHERE statement (which selects cross sections). The attribute statements are the ATTRIBUTE, FORMAT, LABEL, LENGTH, and RENAME statements.
The statements and options used by PROC DATASOURCE are summarized in Table 10.2.
Table 10.2: Summary of SyntaxDescription | Statement | Option |
Input Data File Options | ||
specify the character set of the incoming | PROC DATASOURCE | ASCII |
data | PROC DATASOURCE | EBCDIC |
specify the type of input data file to read | PROC DATASOURCE | FILETYPE= |
specify the fileref(s) of the input data file(s) | PROC DATASOURCE | INFILE= |
specify the lrecl(s) of the input data files(s) | PROC DATASOURCE | LRECL= |
specify the recfm(s) of the input data files(s) | PROC DATASOURCE | RECFM= |
Output Data Set Options | ||
write the extracted time series data | PROC DATASOURCE | OUT= |
output the descriptive information on the time series variables and cross sections | PROC DATASOURCE | OUTALL= |
output the descriptive information on the cross sections | PROC DATASOURCE | OUTBY= |
output the descriptive information on the time series variables | PROC DATASOURCE | OUTCONT= |
write event-oriented data | PROC DATASOURCE | OUTEVENT= |
control whether all or only selected series and cross sections be reported | PROC DATASOURCE | OUTSELECT= |
create single indexes from BY variables for the OUT= data set | PROC DATASOURCE | INDEX |
control the alignment of SAS Date values | PROC DATASOURCE | ALIGN= |
Subsetting | ||
specify the periodicity of series to be extracted | PROC DATASOURCE | INTERVAL= |
specify the time series variables to be included in the OUT= data set | KEEP | |
specify the time series variables to be excluded from the OUT= data set | DROP | |
specify the events to be included in the OUTEVENT= data set | KEEPEVENT | |
specify the events to be excluded from the OUTEVENT= data set | DROPEVENT | |
select cross sections for output | WHERE | |
specify the time range of observations to be output | RANGE | |
Assigning Attributes | ||
assign formats to the output variables | FORMAT | |
ATTRIBUTE | FORMAT= | |
assign labels to variables in the output data sets | LABEL | |
ATTRIBUTE | LABEL= | |
control the lengths of the output variables | LENGTH | |
ATTRIBUTE | LENGTH= | |
assign new names to the output variables | RENAME |
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.