data tq84_a;
val = 1; num = 'one'; output;
val = 2; num = 'two'; output;
run;
data tq84_b;
val = 3; num = 'three'; output;
val = 4; num = 'four' ; output;
run;
data tq84_a_plus_b;
/*
The colon selects all data sets that match
the preceeding string (here: tq84_a and
tq84_b
*/
set tq84_:;
run;
proc print
data = tq84_a_plus_b;
run;
data tq84_in;
input foo bar $ baz $;
datalines;
1 one eins
4 four vier
2 two zwei
9 nine neun
;
data tq84_out;
set tq84_in(keep=foo baz);
run;
proc print data=tq84_out;
run;
data tq84_data;
length num $ 20;
input num $
val;
datalines;
one 1
two 2
three 3
four 4
five 5
six 6
seven 7
eight 8
nine 9
ten 10
eleven 11
twelve 12
thirteen 13
fourteen 14
fivteen 15
sixteen 16
seventeen 17
eighteen 18
nineteen 19
twenty 20
;
data tq84_filtered;
set tq84_data(
where=(num between 's' and 'u')
);
output;
run;
proc print data=tq84_filtered;
run;
data tq84_ds_one;
length x $ 3;
x = "foo"; y = 1; output;
x = "bar"; y = 2; output;
x = "baz"; y = 3; output;
run;
data tq84_ds_two;
length x $ 11;
x = "eleven" ; y = 11; output;
x = "seven" ; y = 7; output;
x = "forty-two" ; y = 42; output;
x = "ninety-nine"; y = 99; output;
run;
data tq84_ds_one_two;
/* Setting the length of x is important.
If it's not set, this step would use the length
of the tq84_ds_one, which is '$ 3'. */
length x $ 11;
set tq84_ds_one
tq84_ds_two;
run;
proc print
data=tq84_ds_one;
run;
data tq84_nums;
length val
txt $20;
input val txt;
datalines;
1 one
2 two
3 three
4 four
5 five
6 six
run;
data tq84_last_num;
set tq84_nums end=tq84_last;;
if tq84_last;
run;