a****r 发帖数: 71 | 1 请教一个《Carpenter's Complete Guide to the SAS Macro》上SAS macro的例子。
Chapter 6, Page 111 有一个根据data A1 里两个变量 station 和 depth 生成 一系
列ACSII文件的macro的例子;
**********************;
***6.2.1d
***%DOIT
**********************;
* 1993 Water quality data.
*************************************************;
data a1
(keep=datetime station depth temp ph do cond salinity);
input datetime datetime13. @15 station $3.
depth temp ph do cond salinity;
label datetime = 'date and time of sample collection'
station = 'station'
depth = 'water depth (ft)'
temp = 'temperature (C)'
ph = 'pH'
do = 'dissolved oxygen'
cond = 'conductivity'
salinity = 'salinity';
format datetime datetime13.;
datalines;
06FEB93:09:15 TS3 0 13.6 7.9 8.8 20.3 12.1
06FEB93:09:15 TS3 1 13.5 7.9 8.7 20.4 12.2
06FEB93:09:15 TS3 2 13.5 7.88 8.7 22.1 13.3
06FEB93:09:15 TS3 3 14.1 8.05 9 46.2 29.9
06FEB93:09:15 TS3 4 14.2 8.05 8.9 48.1 31.3
10FEB93:11:51 TS3 0 13.9 7.91 9.5 0.57 0.27
10FEB93:11:51 TS3 1 13.9 7.89 9.5 0.57 0.27
10FEB93:11:51 TS3 2 13.9 7.88 9.4 0.57 0.27
10FEB93:11:51 TS3 3 13.8 7.88 9.5 0.57 0.27
10FEB93:11:51 TS3 4 13.8 7.87 9.4 0.56 0.27
16FEB93:07:36 TS3 0 12.9 7.86 9.1 8.8 4.9
16FEB93:07:36 TS3 1 12.9 7.85 9 9.3 5.19
16FEB93:07:36 TS3 2 13 7.85 8.8 9.7 5.43
16FEB93:07:36 TS3 3 13 7.86 8.8 9.7 5.43
16FEB93:07:36 TS3 4 13 7.85 8.7 9.3 5.19
20FEB93:09:08 TS3 0 13.1 7.99 9.9 0.78 0.38
20FEB93:09:08 TS3 1 13.1 7.99 9.9 0.78 0.38
20FEB93:09:08 TS3 2 13.1 7.99 9.9 0.76 0.37
20FEB93:09:08 TS3 3 13.1 7.98 9.8 0.76 0.37
20FEB93:09:08 TS3 4 13.1 7.97 9.8 0.75 0.36
02MAR93:12:31 TS3 0 14.9 8.03 10.1 0.83 0.41
02MAR93:12:31 TS3 1 14.9 8.03 10.1 0.83 0.41
02MAR93:12:31 TS3 2 14.9 8.01 10.1 0.82 0.41
02MAR93:12:31 TS3 3 14.9 8.01 10 0.82 0.41
02MAR93:12:31 TS3 4 14.9 8.02 10 0.8 0.39
02MAR93:12:31 TS3 5 14.9 8.02 10 0.8 0.39
07MAR93:08:56 TS3 0 14.4 7.92 8.6 11 6.22
07MAR93:08:56 TS3 1 14.3 7.92 8.7 11 6.22
07MAR93:08:56 TS3 2 14.3 7.92 8.7 11.5 6.53
07MAR93:08:56 TS3 3 14.3 7.91 8.7 11.2 6.35
07MAR93:08:56 TS3 4 14.3 7.9 8.8 11.2 6.35
07MAR93:08:56 TS3 5 14.5 8.06 8.8 36.4 23
15MAR93:14:20 TS3 0 19.7 8.35 10.9 1.3 0.65
15MAR93:14:20 TS3 1 19.6 8.33 10.9 1.28 0.64
15MAR93:14:20 TS3 2 19.6 8.34 11.1 1.3 0.65
15MAR93:14:20 TS3 3 19.6 8.34 11.4 1.3 0.65
15MAR93:14:20 TS3 4 19.7 8.33 11.6 1.43 0.71
27MAR93:13:40 TS3 0 16.9 8.4 9.5 0.85 0.42
27MAR93:13:40 TS3 1 16.9 8.39 9.4 0.85 0.42
27MAR93:13:40 TS3 2 16.9 8.39 9.4 0.85 0.42
27MAR93:13:40 TS3 3 16.9 8.38 9.4 0.83 0.41
27MAR93:13:40 TS3 4 16.9 8.38 9.4 0.84 0.41
27MAR93:13:40 TS3 5 16.9 8.36 9.4 0.84 0.41
01APR93:11:03 TS3 0 19 8.42 10 1.44 0.7
01APR93:11:03 TS3 2 19 8.41 9.9 1.44 0.7
01APR93:11:03 TS3 4 18.9 8.4 9.8 1.41 0.7
01APR93:11:03 TS3 6 18.8 8.39 9.6 1.42 0.7
03APR93:06:22 TS3 0 15.2 7.88 7.9 16.2 9.5
03APR93:06:22 TS3 1 15.2 7.88 7.7 17.1 10
03APR93:06:22 TS3 2 15.2 8.01 8.4 49.2 32.1
03APR93:06:22 TS3 3 15.2 8.03 8.3 50.9 33.4
03APR93:06:22 TS3 4 15.2 8.03 8.3 50.8 33.3
03APR93:06:22 TS3 5 15.2 8.03 8.3 50.5 33.1
06APR93:09:00 TS3 0 15.7 . 8.4 51.4 33.8
06APR93:09:00 TS3 2 15.6 8.14 . 51.5 33.8
06APR93:09:00 TS3 4 . 8.12 . . .
06APR93:09:00 TS3 6 15.6 8.11 8.1 . .
07APR93:09:15 TS3 0 17.1 8.16 8.8 49.8 32.6
07APR93:09:15 TS3 2 17.1 8.16 8.6 49.8 32.6
07APR93:09:15 TS3 4 17.1 8.15 8.6 49.7 32.5
07APR93:09:15 TS3 6 17.1 8.14 8.5 49.8 32.6
22APR93:10:20 TS3 0 17.1 8.22 8.6 48.5 31.6
22APR93:10:20 TS3 2 17.1 8.2 8.6 48.5 31.6
22APR93:10:20 TS3 4 17 8.19 8.5 48.5 31.6
22APR93:10:20 TS3 6 17 8.15 8.1 48.5 31.6
24APR93:12:06 TS3 0 18.8 8.1 8.3 45.5 29.5
24APR93:12:06 TS3 2 18.8 8.09 8.1 45.5 29.5
24APR93:12:06 TS3 4 18.8 8.1 8 45.3 29.3
24APR93:12:06 TS3 6 18.8 8.13 7.8 45.5 29.5
29APR93:12:09 TS3 0 21.8 8.07 7.2 28.2 17.3
29APR93:12:09 TS3 1 21.4 8.15 7.7 35.7 22.5
29APR93:12:09 TS3 2 21.2 8.19 7.7 39.7 25.3
29APR93:12:09 TS3 4 20.7 8.17 7.8 41.8 26.8
29APR93:12:09 TS3 5 19.9 8.16 7.2 41.8 26.8
29APR93:12:09 TS3 6 18.8 8.08 5.9 45.3 29.3
05MAY93:09:24 TS3 0 17.7 8.18 7.9 51 33.5
05MAY93:09:24 TS3 2 17.7 8.18 7.9 50.8 33.3
05MAY93:09:24 TS3 4 17.7 8.17 7.8 51 33.5
05MAY93:09:24 TS3 6 17.7 8.17 7.8 50.8 33.3
15MAY93:11:25 TS3 0 19.6 8.11 7.2 42.8 27.5
15MAY93:11:25 TS3 2 19.3 8.13 7.2 44.9 29
15MAY93:11:25 TS3 4 19.2 8.13 7.2 45.8 29.7
15MAY93:11:25 TS3 6 18.5 8.15 7.5 46.8 30.4
23MAY93:12:06 TS3 0 17.4 8.19 7.8 51.3 33.7
23MAY93:12:06 TS3 2 17.3 8.19 7.8 51.2 33.6
23MAY93:12:06 TS3 4 17.3 8.18 7.7 51.1 33.5
23MAY93:12:06 TS3 6 17.3 8.18 7.7 51.2 33.6
01JUN93:12:00 TS3 0 18.9 8.13 8.8 50.7 33.2
01JUN93:12:00 TS3 2 18.8 8.12 8.8 50.8 33.8
01JUN93:12:00 TS3 4 18.8 8.11 8.7 50.7 33.2
01JUN93:12:00 TS3 6 18.7 8.12 8.6 50.7 33.2
03JUN93:20:08 TS3 0 18.6 8.31 8 52.7 34.7
03JUN93:20:08 TS3 2 18.6 8.31 8 52.6 34.6
03JUN93:20:08 TS3 4 18.5 8.3 8 52.6 34.6
03JUN93:20:08 TS3 6 18.5 8.31 8 52.5 34.6
04JUN93:06:02 TS3 0 19.9 8.08 5.1 50.2 32.9
04JUN93:06:02 TS3 2 19.8 8.07 5 50.4 33
04JUN93:06:02 TS3 4 19.9 8.07 5 50.3 32.9
04JUN93:06:02 TS3 6 19.9 8.07 4.9 50.3 32.9
11JUN93:09:50 TS3 0 23 7.92 3.8 51 33.5
11JUN93:09:50 TS3 2 23 7.92 3.8 51.1 33.5
11JUN93:09:50 TS3 4 22.9 7.92 3.8 50.7 33.2
11JUN93:09:50 TS3 6 22.7 7.92 3.7 51.1 33.5
16JUN93:13:03 TS3 0 22.1 8.16 8.5 52.3 34.4
16JUN93:13:03 TS3 2 22 8.15 8.2 52.1 34.3
16JUN93:13:03 TS3 4 22 8.15 8.1 51.9 34.1
16JUN93:13:03 TS3 6 22 8.15 8.1 51.7 34
06FEB93:09:43 TS6 0 13.9 8.07 8.8 32.5 20.3
06FEB93:09:43 TS6 1 13.9 8.05 8.7 38.1 24.2
06FEB93:09:43 TS6 2 14 8.06 8.6 44.6 28.8
06FEB93:09:43 TS6 3 14.1 8.06 8.4 45.5 29.4
06FEB93:09:43 TS6 4 14.1 8.04 8.6 49.2 32.1
06FEB93:09:43 TS6 5 14.2 8.06 8.7 50.3 32.9
06FEB93:09:43 TS6 6 14.3 8.06 8.7 51.1 33.5
10FEB93:12:22 TS6 0 14.2 7.96 9.5 0.59 0.29
10FEB93:12:22 TS6 1 14.1 7.94 9.4 0.59 0.29
10FEB93:12:22 TS6 2 13.8 7.92 9.2 0.82 0.4
10FEB93:12:22 TS6 3 13.8 7.88 9.1 1.07 0.53
10FEB93:12:22 TS6 4 13.7 7.86 8.8 1.76 0.89
10FEB93:12:22 TS6 5 13.6 7.78 8.4 3.82 2
16FEB93:08:18 TS6 0 13.6 8.32 9.7 3.4 1.77
16FEB93:08:18 TS6 1 13.6 8.26 9.6 4.39 2.33
16FEB93:08:18 TS6 2 13.6 8.2 9.5 5.34 2.87
16FEB93:08:18 TS6 3 13.5 8.08 9.1 7.97 4.4
16FEB93:08:18 TS6 4 13.6 7.86 8.8 15 8.7
20FEB93:09:50 TS6 0 13.4 8.02 9.7 1.08 0.53
20FEB93:09:50 TS6 1 13.3 7.97 9.7 1.06 0.53
20FEB93:09:50 TS6 2 13.2 7.97 9.7 1.1 0.54
20FEB93:09:50 TS6 3 13.4 7.96 9.5 2.83 1.46
20FEB93:09:50 TS6 4 13.5 7.96 9.3 4.56 2.42
20FEB93:09:50 TS6 5 13.8 7.95 9.2 7.25 3.98
20FEB93:09:50 TS6 6 14.8 8.13 8.4 8.8 4.89
20FEB93:09:50 TS6 7 15.2 8.03 7.6 28.2 17.3
20FEB93:09:50 TS6 7.5 15.2 8.02 7.1 30.6 18.9
02MAR93:14:20 TS6 0 16 8.21 10.9 0.89 0.43
02MAR93:14:20 TS6 1 15.9 8.2 10.8 0.87 0.42
02MAR93:14:20 TS6 2 15.9 8.19 10.7 0.87 0.42
02MAR93:14:20 TS6 2.5 15.9 8.19 10.6 0.88 0.43
07MAR93:10:30 TS6 0 16.2 8.08 9.3 7.61 4.18
07MAR93:10:30 TS6 1 15.8 8.11 9.5 11.7 6.65
07MAR93:10:30 TS6 2 15.3 8.14 10 18.3 10.8
07MAR93:10:30 TS6 3 14.9 8.09 10.4 25.6 15.6
07MAR93:10:30 TS6 4 14.6 8.06 10.7 27.2 16.7
07MAR93:10:30 TS6 5 14.5 8.04 10.5 31.4 19.5
15MAR93:16:43 TS6 0 19.2 8.39 . 0.92 0.45
15MAR93:16:43 TS6 1 19.3 8.38 . 0.92 0.45
15MAR93:16:43 TS6 2 19.3 8.38 . 0.94 0.46
15MAR93:16:43 TS6 3 19.3 8.37 . 0.93 0.45
15MAR93:16:43 TS6 3.5 19.4 8.37 . 0.93 0.45
27MAR93:14:57 TS6 0 18 8.6 11.6 3.71 1.95
27MAR93:14:57 TS6 1 17.6 8.67 12.4 4.75 2.54
27MAR93:14:57 TS6 2 17.4 8.59 11.8 9.24 5.2
27MAR93:14:57 TS6 3 17.3 8.6 11.8 9.89 5.6
27MAR93:14:57 TS6 3.5 17.3 8.59 11.9 10.1 5.7
01APR93:13:40 TS6 0 23.9 9.56 23.3 3.85 2
01APR93:13:40 TS6 1 23.9 9.55 23.6 3.82 2
01APR93:13:40 TS6 2 23.9 9.53 23.1 3.75 2
01APR93:13:40 TS6 3 23.9 9.53 23 3.79 2
03APR93:08:03 TS6 0 16.8 8.2 8.7 10.1 5.7
06APR93:11:08 TS6 0 17 8 8.2 25.6 15.6
06APR93:11:08 TS6 1 16.8 8.06 8.3 33.8 21.2
06APR93:11:08 TS6 2 16.4 8.14 9.2 43.1 27.7
06APR93:11:08 TS6 3 16.3 8.16 9.6 44.5 28.7
06APR93:11:08 TS6 4 16.2 8.17 9.7 46 29.8
06APR93:11:08 TS6 5 16.2 8.17 9.8 46 29.8
07APR93:10:49 TS6 0 18 7.88 7.3 7.4 4.1
07APR93:10:49 TS6 1 17.5 8.13 8.1 49 32
07APR93:10:49 TS6 2 17.5 8.13 8.1 48.9 31.9
07APR93:10:49 TS6 3 17.5 8.12 8.1 49.1 32.1
07APR93:10:49 TS6 4 17.5 8.13 8 49.6 32.4
07APR93:10:49 TS6 5 17.5 8.13 8 49.5 32.4
22APR93:11:45 TS6 0 18.7 7.84 8.4 45.5 29.5
22APR93:11:45 TS6 1 18.3 7.82 8.8 47.5 30.9
22APR93:11:45 TS6 2 18.2 7.92 8.7 48.1 31.3
22APR93:11:45 TS6 3 18.2 7.9 8.7 48.1 31.3
22APR93:11:45 TS6 4 18.2 7.97 8.6 48.1 31.3
24APR93:14:05 TS6 0 21.5 8.28 10.2 45.6 29.5
24APR93:14:05 TS6 1 21.5 8.27 9.9 45.4 29.4
24APR93:14:05 TS6 2 21.3 8.28 9.8 45.4 29.4
24APR93:14:05 TS6 3.5 21.3 8.29 9.7 45.6 29.5
29APR93:13:42 TS6 0 25.7 8.22 8.2 40.2 25.7
29APR93:13:42 TS6 1 25.7 8.21 8.1 40.7 26
29APR93:13:42 TS6 2 25.8 8.2 8.1 40.1 25.6
29APR93:13:42 TS6 3 26.1 8.2 8 40.4 25.7
05MAY93:11:03 TS6 0 18.6 8.19 8.2 50.5 33.1
05MAY93:11:03 TS6 2 18.6 8.19 8.2 50.3 32.9
05MAY93:11:03 TS6 4 18.6 8.18 8.2 50.5 33.1
05MAY93:11:03 TS6 5 18.6 8.18 8.1 50.1 32.8
15MAY93:13:54 TS6 0 23.9 8.1 7 46.2 30
15MAY93:13:54 TS6 1 23.9 8.11 7.2 46.3 30
15MAY93:13:54 TS6 2 24 8.15 7.5 47.3 30.8
15MAY93:13:54 TS6 3 24.1 8.16 7.6 47.5 30.9
23MAY93:15:04 TS6 0 19.8 8.2 8.1 51.3 33.7
23MAY93:15:04 TS6 2 19.8 8.2 8.1 51.7 34
23MAY93:15:04 TS6 4 19.8 8.2 8.1 51.1 33.5
01JUN93:14:07 TS6 0 25.5 8.23 7.8 52.9 34.9
01JUN93:14:07 TS6 1 25.3 8.22 7.7 52.6 34.6
01JUN93:14:07 TS6 2 25.5 8.22 7.7 52.7 34.7
01JUN93:14:07 TS6 3 25.5 8.21 7.6 52.7 34.7
03JUN93:21:20 TS6 0 18.5 8.34 7.9 52.9 34.9
03JUN93:21:20 TS6 2 18.5 8.33 7.8 52.9 34.9
03JUN93:21:20 TS6 4 18.5 8.33 7.8 52.9 34.9
03JUN93:21:20 TS6 6 18.5 8.33 7.7 53 34.9
03JUN93:21:20 TS6 8 18.5 8.33 7.6 52.9 34.9
04JUN93:07:20 TS6 0 18.8 8.05 3.6 52.2 34.4
04JUN93:07:20 TS6 1 18.7 8.05 3.6 52.7 34.7
04JUN93:07:20 TS6 2 18.8 8.04 3.5 51.6 33.9
04JUN93:07:20 TS6 3 18.8 8.04 3.4 51.6 33.9
11JUN93:11:42 TS6 0 26.2 8.1 6.3 53 34.9
11JUN93:11:42 TS6 1 26.1 8.1 6.2 53 34.9
11JUN93:11:42 TS6 2 26.1 8.08 6 52.9 34.9
11JUN93:11:42 TS6 3 26.1 8.08 6 53 34.9
16JUN93:15:00 TS6 0 25.9 8.11 8.3 51.6 33.9
16JUN93:15:00 TS6 2 25.8 8.12 8.3 51.3 33.7
16JUN93:15:00 TS6 4 25.6 8.12 8.2 52.1 34.3
run;
proc sort data=a1;
by station depth;
run;
%macro doit;
* Create the macro variables.
* One set for each STATION X DEPTH;
data _null_;
set a1;
by station depth;
length ii $1 dd $2 fn $14;
if first.depth then do;
i+1;
ii = left(put(i,2.));
* Create a character value of the numeric depth;
dd = trim(left(put(depth,3.)));
* Construct the filename;
fn = compress(station || dd || '.dat');
call symput('i',ii);
call symput('d'||ii,dd);
call symput('sta'||ii,station);
call symput('fn'||ii,fn);
end;
run;
* There will be &i files;
%do j=1 %to &i;
filename toascii "&&fn&j";
* print the ascii files;
data _null_;
set a1;
where station="&&sta&j" and depth=&&d&j;
cnt + 1;
file toascii;
if cnt=1 then put '********** ' "&&fn&j";
put @1 date mmddyy8. @10 aveday;
run;
%end;
%mend doit;
%doit
这个macro 明显的错误似乎是 %do j=1 %to &i; 我改成
call symput('total',i);
然后
%do j=1 %to &total;
但是程序虽然total是19,却生成不了19个dat文件。请教一下,这个macro有什么问题? | s******8 发帖数: 102 | 2 你可能改得不够。若如你所说19个,那么 length ii $1. ii = left(put(i,2.)); ii
取值1-9,10-19变成1了。
你是否可以试一下,只改动 length ii $2.; | a****r 发帖数: 71 | 3 恩,是这个原因,多谢,:)
ii
【在 s******8 的大作中提到】 : 你可能改得不够。若如你所说19个,那么 length ii $1. ii = left(put(i,2.)); ii : 取值1-9,10-19变成1了。 : 你是否可以试一下,只改动 length ii $2.;
| s********1 发帖数: 54 | 4 ______________________________________________
I got the following error message:
______________________________________________
ERROR: Insufficient authorization to access C:\Program Files\SASHome\
SASFoundation\9.3\TS30.dat
______________________________________________
My code is as follows:
______________________________________________
**********************;
***6.2.1d
***%DOIT
**********************;
* 1993 Water quality data.
*************************************************;
data a1
(keep=datetime station depth temp ph do cond salinity);
input datetime datetime13. @15 station $3.
depth temp ph do cond salinity;
label datetime = 'date and time of sample collection'
station = 'station'
depth = 'water depth (ft)'
temp = 'temperature (C)'
ph = 'pH'
do = 'dissolved oxygen'
cond = 'conductivity'
salinity = 'salinity';
format datetime datetime13.;
datalines;
06FEB93:09:15 TS3 0 13.6 7.9 8.8 20.3 12.1
06FEB93:09:15 TS3 1 13.5 7.9 8.7 20.4 12.2
06FEB93:09:15 TS3 2 13.5 7.88 8.7 22.1 13.3
06FEB93:09:15 TS3 3 14.1 8.05 9 46.2 29.9
06FEB93:09:15 TS3 4 14.2 8.05 8.9 48.1 31.3
10FEB93:11:51 TS3 0 13.9 7.91 9.5 0.57 0.27
10FEB93:11:51 TS3 1 13.9 7.89 9.5 0.57 0.27
10FEB93:11:51 TS3 2 13.9 7.88 9.4 0.57 0.27
10FEB93:11:51 TS3 3 13.8 7.88 9.5 0.57 0.27
10FEB93:11:51 TS3 4 13.8 7.87 9.4 0.56 0.27
16FEB93:07:36 TS3 0 12.9 7.86 9.1 8.8 4.9
16FEB93:07:36 TS3 1 12.9 7.85 9 9.3 5.19
16FEB93:07:36 TS3 2 13 7.85 8.8 9.7 5.43
16FEB93:07:36 TS3 3 13 7.86 8.8 9.7 5.43
16FEB93:07:36 TS3 4 13 7.85 8.7 9.3 5.19
20FEB93:09:08 TS3 0 13.1 7.99 9.9 0.78 0.38
20FEB93:09:08 TS3 1 13.1 7.99 9.9 0.78 0.38
20FEB93:09:08 TS3 2 13.1 7.99 9.9 0.76 0.37
20FEB93:09:08 TS3 3 13.1 7.98 9.8 0.76 0.37
20FEB93:09:08 TS3 4 13.1 7.97 9.8 0.75 0.36
02MAR93:12:31 TS3 0 14.9 8.03 10.1 0.83 0.41
02MAR93:12:31 TS3 1 14.9 8.03 10.1 0.83 0.41
02MAR93:12:31 TS3 2 14.9 8.01 10.1 0.82 0.41
02MAR93:12:31 TS3 3 14.9 8.01 10 0.82 0.41
02MAR93:12:31 TS3 4 14.9 8.02 10 0.8 0.39
02MAR93:12:31 TS3 5 14.9 8.02 10 0.8 0.39
07MAR93:08:56 TS3 0 14.4 7.92 8.6 11 6.22
07MAR93:08:56 TS3 1 14.3 7.92 8.7 11 6.22
07MAR93:08:56 TS3 2 14.3 7.92 8.7 11.5 6.53
07MAR93:08:56 TS3 3 14.3 7.91 8.7 11.2 6.35
07MAR93:08:56 TS3 4 14.3 7.9 8.8 11.2 6.35
07MAR93:08:56 TS3 5 14.5 8.06 8.8 36.4 23
15MAR93:14:20 TS3 0 19.7 8.35 10.9 1.3 0.65
15MAR93:14:20 TS3 1 19.6 8.33 10.9 1.28 0.64
15MAR93:14:20 TS3 2 19.6 8.34 11.1 1.3 0.65
15MAR93:14:20 TS3 3 19.6 8.34 11.4 1.3 0.65
15MAR93:14:20 TS3 4 19.7 8.33 11.6 1.43 0.71
27MAR93:13:40 TS3 0 16.9 8.4 9.5 0.85 0.42
27MAR93:13:40 TS3 1 16.9 8.39 9.4 0.85 0.42
27MAR93:13:40 TS3 2 16.9 8.39 9.4 0.85 0.42
27MAR93:13:40 TS3 3 16.9 8.38 9.4 0.83 0.41
27MAR93:13:40 TS3 4 16.9 8.38 9.4 0.84 0.41
27MAR93:13:40 TS3 5 16.9 8.36 9.4 0.84 0.41
01APR93:11:03 TS3 0 19 8.42 10 1.44 0.7
01APR93:11:03 TS3 2 19 8.41 9.9 1.44 0.7
01APR93:11:03 TS3 4 18.9 8.4 9.8 1.41 0.7
01APR93:11:03 TS3 6 18.8 8.39 9.6 1.42 0.7
03APR93:06:22 TS3 0 15.2 7.88 7.9 16.2 9.5
03APR93:06:22 TS3 1 15.2 7.88 7.7 17.1 10
03APR93:06:22 TS3 2 15.2 8.01 8.4 49.2 32.1
03APR93:06:22 TS3 3 15.2 8.03 8.3 50.9 33.4
03APR93:06:22 TS3 4 15.2 8.03 8.3 50.8 33.3
03APR93:06:22 TS3 5 15.2 8.03 8.3 50.5 33.1
06APR93:09:00 TS3 0 15.7 . 8.4 51.4 33.8
06APR93:09:00 TS3 2 15.6 8.14 . 51.5 33.8
06APR93:09:00 TS3 4 . 8.12 . . .
06APR93:09:00 TS3 6 15.6 8.11 8.1 . .
07APR93:09:15 TS3 0 17.1 8.16 8.8 49.8 32.6
07APR93:09:15 TS3 2 17.1 8.16 8.6 49.8 32.6
07APR93:09:15 TS3 4 17.1 8.15 8.6 49.7 32.5
07APR93:09:15 TS3 6 17.1 8.14 8.5 49.8 32.6
22APR93:10:20 TS3 0 17.1 8.22 8.6 48.5 31.6
22APR93:10:20 TS3 2 17.1 8.2 8.6 48.5 31.6
22APR93:10:20 TS3 4 17 8.19 8.5 48.5 31.6
22APR93:10:20 TS3 6 17 8.15 8.1 48.5 31.6
24APR93:12:06 TS3 0 18.8 8.1 8.3 45.5 29.5
24APR93:12:06 TS3 2 18.8 8.09 8.1 45.5 29.5
24APR93:12:06 TS3 4 18.8 8.1 8 45.3 29.3
24APR93:12:06 TS3 6 18.8 8.13 7.8 45.5 29.5
29APR93:12:09 TS3 0 21.8 8.07 7.2 28.2 17.3
29APR93:12:09 TS3 1 21.4 8.15 7.7 35.7 22.5
29APR93:12:09 TS3 2 21.2 8.19 7.7 39.7 25.3
29APR93:12:09 TS3 4 20.7 8.17 7.8 41.8 26.8
29APR93:12:09 TS3 5 19.9 8.16 7.2 41.8 26.8
29APR93:12:09 TS3 6 18.8 8.08 5.9 45.3 29.3
05MAY93:09:24 TS3 0 17.7 8.18 7.9 51 33.5
05MAY93:09:24 TS3 2 17.7 8.18 7.9 50.8 33.3
05MAY93:09:24 TS3 4 17.7 8.17 7.8 51 33.5
05MAY93:09:24 TS3 6 17.7 8.17 7.8 50.8 33.3
15MAY93:11:25 TS3 0 19.6 8.11 7.2 42.8 27.5
15MAY93:11:25 TS3 2 19.3 8.13 7.2 44.9 29
15MAY93:11:25 TS3 4 19.2 8.13 7.2 45.8 29.7
15MAY93:11:25 TS3 6 18.5 8.15 7.5 46.8 30.4
23MAY93:12:06 TS3 0 17.4 8.19 7.8 51.3 33.7
23MAY93:12:06 TS3 2 17.3 8.19 7.8 51.2 33.6
23MAY93:12:06 TS3 4 17.3 8.18 7.7 51.1 33.5
23MAY93:12:06 TS3 6 17.3 8.18 7.7 51.2 33.6
01JUN93:12:00 TS3 0 18.9 8.13 8.8 50.7 33.2
01JUN93:12:00 TS3 2 18.8 8.12 8.8 50.8 33.8
01JUN93:12:00 TS3 4 18.8 8.11 8.7 50.7 33.2
01JUN93:12:00 TS3 6 18.7 8.12 8.6 50.7 33.2
03JUN93:20:08 TS3 0 18.6 8.31 8 52.7 34.7
03JUN93:20:08 TS3 2 18.6 8.31 8 52.6 34.6
03JUN93:20:08 TS3 4 18.5 8.3 8 52.6 34.6
03JUN93:20:08 TS3 6 18.5 8.31 8 52.5 34.6
04JUN93:06:02 TS3 0 19.9 8.08 5.1 50.2 32.9
04JUN93:06:02 TS3 2 19.8 8.07 5 50.4 33
04JUN93:06:02 TS3 4 19.9 8.07 5 50.3 32.9
04JUN93:06:02 TS3 6 19.9 8.07 4.9 50.3 32.9
11JUN93:09:50 TS3 0 23 7.92 3.8 51 33.5
11JUN93:09:50 TS3 2 23 7.92 3.8 51.1 33.5
11JUN93:09:50 TS3 4 22.9 7.92 3.8 50.7 33.2
11JUN93:09:50 TS3 6 22.7 7.92 3.7 51.1 33.5
16JUN93:13:03 TS3 0 22.1 8.16 8.5 52.3 34.4
16JUN93:13:03 TS3 2 22 8.15 8.2 52.1 34.3
16JUN93:13:03 TS3 4 22 8.15 8.1 51.9 34.1
16JUN93:13:03 TS3 6 22 8.15 8.1 51.7 34
06FEB93:09:43 TS6 0 13.9 8.07 8.8 32.5 20.3
06FEB93:09:43 TS6 1 13.9 8.05 8.7 38.1 24.2
06FEB93:09:43 TS6 2 14 8.06 8.6 44.6 28.8
06FEB93:09:43 TS6 3 14.1 8.06 8.4 45.5 29.4
06FEB93:09:43 TS6 4 14.1 8.04 8.6 49.2 32.1
06FEB93:09:43 TS6 5 14.2 8.06 8.7 50.3 32.9
06FEB93:09:43 TS6 6 14.3 8.06 8.7 51.1 33.5
10FEB93:12:22 TS6 0 14.2 7.96 9.5 0.59 0.29
10FEB93:12:22 TS6 1 14.1 7.94 9.4 0.59 0.29
10FEB93:12:22 TS6 2 13.8 7.92 9.2 0.82 0.4
10FEB93:12:22 TS6 3 13.8 7.88 9.1 1.07 0.53
10FEB93:12:22 TS6 4 13.7 7.86 8.8 1.76 0.89
10FEB93:12:22 TS6 5 13.6 7.78 8.4 3.82 2
16FEB93:08:18 TS6 0 13.6 8.32 9.7 3.4 1.77
16FEB93:08:18 TS6 1 13.6 8.26 9.6 4.39 2.33
16FEB93:08:18 TS6 2 13.6 8.2 9.5 5.34 2.87
16FEB93:08:18 TS6 3 13.5 8.08 9.1 7.97 4.4
16FEB93:08:18 TS6 4 13.6 7.86 8.8 15 8.7
20FEB93:09:50 TS6 0 13.4 8.02 9.7 1.08 0.53
20FEB93:09:50 TS6 1 13.3 7.97 9.7 1.06 0.53
20FEB93:09:50 TS6 2 13.2 7.97 9.7 1.1 0.54
20FEB93:09:50 TS6 3 13.4 7.96 9.5 2.83 1.46
20FEB93:09:50 TS6 4 13.5 7.96 9.3 4.56 2.42
20FEB93:09:50 TS6 5 13.8 7.95 9.2 7.25 3.98
20FEB93:09:50 TS6 6 14.8 8.13 8.4 8.8 4.89
20FEB93:09:50 TS6 7 15.2 8.03 7.6 28.2 17.3
20FEB93:09:50 TS6 7.5 15.2 8.02 7.1 30.6 18.9
02MAR93:14:20 TS6 0 16 8.21 10.9 0.89 0.43
02MAR93:14:20 TS6 1 15.9 8.2 10.8 0.87 0.42
02MAR93:14:20 TS6 2 15.9 8.19 10.7 0.87 0.42
02MAR93:14:20 TS6 2.5 15.9 8.19 10.6 0.88 0.43
07MAR93:10:30 TS6 0 16.2 8.08 9.3 7.61 4.18
07MAR93:10:30 TS6 1 15.8 8.11 9.5 11.7 6.65
07MAR93:10:30 TS6 2 15.3 8.14 10 18.3 10.8
07MAR93:10:30 TS6 3 14.9 8.09 10.4 25.6 15.6
07MAR93:10:30 TS6 4 14.6 8.06 10.7 27.2 16.7
07MAR93:10:30 TS6 5 14.5 8.04 10.5 31.4 19.5
15MAR93:16:43 TS6 0 19.2 8.39 . 0.92 0.45
15MAR93:16:43 TS6 1 19.3 8.38 . 0.92 0.45
15MAR93:16:43 TS6 2 19.3 8.38 . 0.94 0.46
15MAR93:16:43 TS6 3 19.3 8.37 . 0.93 0.45
15MAR93:16:43 TS6 3.5 19.4 8.37 . 0.93 0.45
27MAR93:14:57 TS6 0 18 8.6 11.6 3.71 1.95
27MAR93:14:57 TS6 1 17.6 8.67 12.4 4.75 2.54
27MAR93:14:57 TS6 2 17.4 8.59 11.8 9.24 5.2
27MAR93:14:57 TS6 3 17.3 8.6 11.8 9.89 5.6
27MAR93:14:57 TS6 3.5 17.3 8.59 11.9 10.1 5.7
01APR93:13:40 TS6 0 23.9 9.56 23.3 3.85 2
01APR93:13:40 TS6 1 23.9 9.55 23.6 3.82 2
01APR93:13:40 TS6 2 23.9 9.53 23.1 3.75 2
01APR93:13:40 TS6 3 23.9 9.53 23 3.79 2
03APR93:08:03 TS6 0 16.8 8.2 8.7 10.1 5.7
06APR93:11:08 TS6 0 17 8 8.2 25.6 15.6
06APR93:11:08 TS6 1 16.8 8.06 8.3 33.8 21.2
06APR93:11:08 TS6 2 16.4 8.14 9.2 43.1 27.7
06APR93:11:08 TS6 3 16.3 8.16 9.6 44.5 28.7
06APR93:11:08 TS6 4 16.2 8.17 9.7 46 29.8
06APR93:11:08 TS6 5 16.2 8.17 9.8 46 29.8
07APR93:10:49 TS6 0 18 7.88 7.3 7.4 4.1
07APR93:10:49 TS6 1 17.5 8.13 8.1 49 32
07APR93:10:49 TS6 2 17.5 8.13 8.1 48.9 31.9
07APR93:10:49 TS6 3 17.5 8.12 8.1 49.1 32.1
07APR93:10:49 TS6 4 17.5 8.13 8 49.6 32.4
07APR93:10:49 TS6 5 17.5 8.13 8 49.5 32.4
22APR93:11:45 TS6 0 18.7 7.84 8.4 45.5 29.5
22APR93:11:45 TS6 1 18.3 7.82 8.8 47.5 30.9
22APR93:11:45 TS6 2 18.2 7.92 8.7 48.1 31.3
22APR93:11:45 TS6 3 18.2 7.9 8.7 48.1 31.3
22APR93:11:45 TS6 4 18.2 7.97 8.6 48.1 31.3
24APR93:14:05 TS6 0 21.5 8.28 10.2 45.6 29.5
24APR93:14:05 TS6 1 21.5 8.27 9.9 45.4 29.4
24APR93:14:05 TS6 2 21.3 8.28 9.8 45.4 29.4
24APR93:14:05 TS6 3.5 21.3 8.29 9.7 45.6 29.5
29APR93:13:42 TS6 0 25.7 8.22 8.2 40.2 25.7
29APR93:13:42 TS6 1 25.7 8.21 8.1 40.7 26
29APR93:13:42 TS6 2 25.8 8.2 8.1 40.1 25.6
29APR93:13:42 TS6 3 26.1 8.2 8 40.4 25.7
05MAY93:11:03 TS6 0 18.6 8.19 8.2 50.5 33.1
05MAY93:11:03 TS6 2 18.6 8.19 8.2 50.3 32.9
05MAY93:11:03 TS6 4 18.6 8.18 8.2 50.5 33.1
05MAY93:11:03 TS6 5 18.6 8.18 8.1 50.1 32.8
15MAY93:13:54 TS6 0 23.9 8.1 7 46.2 30
15MAY93:13:54 TS6 1 23.9 8.11 7.2 46.3 30
15MAY93:13:54 TS6 2 24 8.15 7.5 47.3 30.8
15MAY93:13:54 TS6 3 24.1 8.16 7.6 47.5 30.9
23MAY93:15:04 TS6 0 19.8 8.2 8.1 51.3 33.7
23MAY93:15:04 TS6 2 19.8 8.2 8.1 51.7 34
23MAY93:15:04 TS6 4 19.8 8.2 8.1 51.1 33.5
01JUN93:14:07 TS6 0 25.5 8.23 7.8 52.9 34.9
01JUN93:14:07 TS6 1 25.3 8.22 7.7 52.6 34.6
01JUN93:14:07 TS6 2 25.5 8.22 7.7 52.7 34.7
01JUN93:14:07 TS6 3 25.5 8.21 7.6 52.7 34.7
03JUN93:21:20 TS6 0 18.5 8.34 7.9 52.9 34.9
03JUN93:21:20 TS6 2 18.5 8.33 7.8 52.9 34.9
03JUN93:21:20 TS6 4 18.5 8.33 7.8 52.9 34.9
03JUN93:21:20 TS6 6 18.5 8.33 7.7 53 34.9
03JUN93:21:20 TS6 8 18.5 8.33 7.6 52.9 34.9
04JUN93:07:20 TS6 0 18.8 8.05 3.6 52.2 34.4
04JUN93:07:20 TS6 1 18.7 8.05 3.6 52.7 34.7
04JUN93:07:20 TS6 2 18.8 8.04 3.5 51.6 33.9
04JUN93:07:20 TS6 3 18.8 8.04 3.4 51.6 33.9
11JUN93:11:42 TS6 0 26.2 8.1 6.3 53 34.9
11JUN93:11:42 TS6 1 26.1 8.1 6.2 53 34.9
11JUN93:11:42 TS6 2 26.1 8.08 6 52.9 34.9
11JUN93:11:42 TS6 3 26.1 8.08 6 53 34.9
16JUN93:15:00 TS6 0 25.9 8.11 8.3 51.6 33.9
16JUN93:15:00 TS6 2 25.8 8.12 8.3 51.3 33.7
16JUN93:15:00 TS6 4 25.6 8.12 8.2 52.1 34.3
run;
proc sort data=a1;
by station depth;
run;
%macro doit;
* Create the macro variables.
* One set for each STATION X DEPTH;
data _null_;
set a1;
by station depth;
length ii $2 dd $2 fn $14;
if first.depth then do;
i+1;
ii = left(put(i,2.));
* Create a character value of the numeric depth;
dd = trim(left(put(depth,3.)));
* Construct the filename;
fn = compress(station || dd || '.dat');
call symput('i',ii);
call symput('d'||ii,dd);
call symput('sta'||ii,station);
call symput('fn'||ii,fn);
call symput('total',i);
end;
run;
* There will be &i files;
%do j=1 %to &total;
filename toascii "&&fn&j";
* print the ascii files;
data _null_;
set a1;
where station="&&sta&j" and depth=&&d&j;
cnt + 1;
file toascii;
if cnt=1 then put '********** ' "&&fn&j";
put @1 date mmddyy8. @10 aveday;
run;
%end;
%mend doit;
%doit;
run; |
|