(View the complete code for this example.)
This example shows how to use the FILTERBY= and FILTERBYCONDITION= options to retrieve the data for one weather station (WSR_ID=KFWS) by using the hail storm data from the NX3HAIL database for May 21, 2011. The output is shown in Output 50.4.1.
options validvarname=any;
title 'Retrieve NX3HAIL Data for WSR_ID=KFWS on May 21, 2011';
libname mylib "/sasusr/noaa/doc/";
libname noaa sasenoaa "%sysget(NOAA_DATA)"
noaaset=nx3hail
range='20110521:20110522'
filterBy='WSR_ID:KFWS'
filterByCondition='WSR_ID:or'
outXml=myCby
automap=replace
mapref=MyMap
xmlmap="%sysget(NOAA_DATA)myCby.map"
format=XML
;
data mylib.HAILbyC;
set noaa.myCby;
run;
proc contents data=mylib.HAILbyC; run;
proc print data=mylib.HAILbyC(obs=10); run;
Output 50.4.1: Severe Hail Storm Data Using FILTERBY= Option for Weather Station KFWS on May 21, 2011
| Retrieve NX3HAIL Data for WSR_ID=KFWS on May 21, 2011 |
| Obs | ztime | wsr_id | cell_id | prob | sevprob | maxsize | shape |
|---|---|---|---|---|---|---|---|
| 1 | 2011-05-21T00:09:38 | KFWS | I3 | 100 | 80 | 1.75 | POINT (-96.6051331772435 31.0844364854615) |
| 2 | 2011-05-21T00:09:38 | KFWS | U8 | 100 | 30 | 0.75 | POINT (-96.7920955739634 31.1345064213377) |
| 3 | 2011-05-21T00:09:38 | KFWS | R0 | 100 | 40 | 1.00 | POINT (-96.1199975968128 31.4803477097816) |
| 4 | 2011-05-21T00:09:38 | KFWS | G6 | 100 | 40 | 1.00 | POINT (-96.8664936098099 31.0651213629879) |
| 5 | 2011-05-21T00:09:38 | KFWS | E9 | 100 | 50 | 1.00 | POINT (-96.5897740989292 31.4208018135191) |
| 6 | 2011-05-21T00:09:38 | KFWS | L8 | 100 | 50 | 1.25 | POINT (-96.253873691341 31.5350758385099) |
| 7 | 2011-05-21T00:09:38 | KFWS | X1 | 100 | 50 | 1.00 | POINT (-95.4408845222209 31.6765991602025) |
| 8 | 2011-05-21T00:09:38 | KFWS | I1 | 100 | 60 | 1.25 | POINT (-96.9732130383308 30.9606322478281) |
| 9 | 2011-05-21T00:09:38 | KFWS | R7 | 100 | 70 | 1.50 | POINT (-96.5356562569208 31.3319818714777) |
| 10 | 2011-05-21T00:18:07 | KFWS | I1 | 100 | 70 | 1.75 | POINT (-96.8885614582821 31.0263076915164) |
You can see that the output data set, myCby, returns only the data for WSR_ID='KFWS' because of the FILTERBY= and FILTERBYCONDITION= options.