  This SAS run uses the RET program's MORE=SAS capability               00000040
  to create a simple ordered list of 'A=AGENCY-CODE' and                00000050
  'S=STATION-ID' keywords.  MORE=SAS is the most efficient              00000060
  way to do this.                                                       00000070
                                                                        00000080
  The output is packed into the first 72 columns of each                00000090
  80-column record, and is suitable for inclusion in any                00000100
  STORET retrieval request which requires primary station               00000110
  codes (REG and WQI, for example).                                     00000120
                                                                        00000130
  The code line "P=1,ED=010101," is a trick to get STORET               00000140
  to create an "FCF" file with no data records.  In the                 00000150
  absence of data, MORE=SAS can only produce delimiter                  00000160
  records at the rate of one per station.  Each delimiter               00000170
  record contains the STORET Agency-Station code in columns             00000180
  1 thru 23 (the STORET "SORT KEY").                                    00000190
                                                                        00000200
  The code line "IF _N_>1;" in the SAS instructions skips               00000210
  the first record in the FCF file.  This record, a delimiter           00000220
  which normally precedes the first valid station, has a                00000230
  sort key filled with binary zeros, and does not contain               00000240
  a valid STORET Agency-Station.                                        00000250
                                                                        00000260
  In this example, stations are selected via the keywords               00000270
  STC=51,CO=059 (Fairfax County, Virginia).  Obviously                  00000280
  any valid station selection technique could have been                 00000290
  substituted here.                                                     00000300
                                                                        00000310
                                                                        00000320
PGM=RET,PURP=208/FED,MORE=SAS,STC=51,CO=059,                            00000330
P=1,ED=010101,                                                          00000340
SASPARMS=BEGIN,                                                         00000350
* - - - - - - - - - - - - - - - - - ;                                   00000360
DATA STNLIST;                                                           00000370
INFILE FCF;                                                             00000380
INPUT @1 AGENCY $8. @9 STATION $15.;                                    00000390
IF _N_>1;                                                               00000400
* - - - - - - - - - - - - - - - - - ;                                   00000410
PROC SORT; BY AGENCY STATION;                                           00000420
* - - - - - - - - - - - - - - - - - ;                                   00000430
PROC PRINT;                                                             00000440
* - - - - - - - - - - - - - - - - - ;                                   00000450
DATA _NULL_; SET STNLIST;                                               00000460
FILE CARDOUT;                                                           00000470
IF AGENCY^=LAG(AGENCY) THEN DO;                                         00000480
        LENGTH=LENGTH(AGENCY);                                          00000490
        LINK CKL;                                                       00000500
        PUT 'A=' AGENCY $VARYING8. LENGTH ',' @;                        00000510
        END;                                                            00000520
LENGTH=LENGTH(STATION);                                                 00000530
LINK CKL;                                                               00000540
PUT 'S=' STATION $VARYING15. LENGTH ',' @;                              00000550
RETURN;                                                                 00000560
* - - - - - - - - - - - - - - - - - ;                                   00000570
CKL: IF LRECL+LENGTH+3 < 72 THEN DO;                                    00000580
                 LRECL+LENGTH+3;                                        00000590
                 RETURN;                                                00000600
                 END;                                                   00000610
     PUT; LRECL=LENGTH+3; RETURN;                                       00000620
* - - - - - - - - - - - - - - - - - ;                                   00000630
STOPSAS,                                                                00000640
./III      JOB (AAAASTORP,MIII),STORET,NOTIFY=III,TIME=(,30),           00000650
./             MSGLEVEL=(1,1),PRTY=4                                    00000660
**ROUTE  PRINT HOLD                                                     00000670
**JOBPARM LINES=10                                                      00000680
./CARDOUT DD DISP=(NEW,CATLG),DSN=IIIAAAA.CARDOUT,                      00000690
./  SPACE=(TRK,(1,1)),                                                  00000700
./  DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160),UNIT=DISK                      00000710
