Example 40.16 Reading Time Series by Defining Fame Expression Groups in the INSET= Option with the KEEP= Clause
To keep all the numeric time series that are listed in the expressions given in the input data set, INSETA, use the INSET=( setname KEEPLIST=fame_expression_group ) and the WILDCARD="?" options. The following statements show how to select time series that are specified in a KEEP expression group and are written to the SAS output data set.
data inseta; /* Use this for d8690 training data base */
length express $52;
express='cvx.close;'; output;
express='{ibm.high,ibm.low,ibm.close};'; output;
express='mave(ibm.close,30);'; output;
express='crosslist({gm,f,c},{volume});'; output;
express='cvx.close+ibm.close;'; output;
express='ibm.close;'; output;
express='sum(pep.volume);'; output;
express='mave(pep.close,20);'; output;
run;
title1 'TRAINING DB, Pricing Timeseries for Expressions in INSET=';
proc print
data=inseta;
run;
Output 40.16.1 shows the expressions that are stored as observations in INSETA.
Output 40.16.1
Listing of INSETA Defining Fame Expression Group
cvx.close; |
{ibm.high,ibm.low,ibm.close}; |
mave(ibm.close,30); |
crosslist({gm,f,c},{volume}); |
cvx.close+ibm.close; |
ibm.close; |
sum(pep.volume); |
mave(pep.close,20); |
The following statements show how to use the INSET= option to keep all of the time series that are represented in INSETA as the group variable named express.
libname libX sasefame "%sysget(FAME_DATA)"
wildcard="?"
convert=(frequency=business technique=constant)
range='23jul1997'd - '25jul1997'd
inset=( inseta KEEP=express)
;
data trout;
set libX.trainten;
run;
title1 'TRAINING DB, Pricing Timeseries for Expressions in INSET=';
proc print data=trout;
run;
proc contents data=trout;
run;
Output 40.16.2 and Output 40.16.3 show the results.
Output 40.16.2
Listing of TROUT using INSETA with KEEP=express
23JUL1997 |
33791.88 |
45864.05 |
37392 |
52.5625 |
53.5000 |
51.5938 |
76.8125 |
47.0894 |
129.375 |
52.5625 |
37.6118 |
24JUL1997 |
41828.85 |
29651.34 |
27771 |
53.9063 |
54.2188 |
52.2500 |
76.8750 |
47.4289 |
130.781 |
53.9063 |
37.6250 |
25JUL1997 |
46979.83 |
36716.77 |
24969 |
53.5000 |
54.2188 |
52.8125 |
78.0000 |
47.7392 |
131.500 |
53.5000 |
37.6546 |
Output 40.16.3
Listing of Contents of TROUT
C.VOLUME |
Num |
8 |
|
|
|
DATE |
Num |
8 |
DATE9. |
9. |
Date of Observation |
GM.VOLUME |
Num |
8 |
|
|
|
IBM.CLOSE |
Num |
8 |
|
|
|
IBM.HIGH |
Num |
8 |
|
|
|
IBM.LOW |
Num |
8 |
|
|
|
SASTEMP1 |
Num |
8 |
|
|
|
SASTEMP3 |
Num |
8 |
|
|
|
SASTEMP5 |
Num |
8 |
|
|
|
SASTEMP6 |
Num |
8 |
|
|
|
SASTEMP8 |
Num |
8 |
|
|
|
VOLUME |
Num |
8 |
|
|
|
Copyright © SAS Institute Inc. All rights reserved.