BLS State and Area Employment, Hours, and Earnings Surveys
/*--------------------------------------------------------------
SAS Sample Library
Name: datex03.sas
Description: Example program from SAS/ETS User's Guide,
The DATASOURCE Procedure
Title: BLS State and Area Employment, Hours, and Earnings Surveys
Product: SAS/ETS Software
System: ALL
Keys: DATASOURCE data extraction from various sources
Procs: DATASOURCE
Data: sasmisc: blseesa.dat (DATASOURCE database files)
Notes: Read this before you run this sample.
The database resides in the ets/sasmisc folder. You
must copy the database to a writeable folder before
using it. Then define your Windows system environment
variable, DATASRC_DATA, to the path of your
writeable folder containing
the blseesa.data file.
To assign a fileref to the external file to be processed,
use the following form of the filename statement:
filename ascifile "%sysget(DATASRC_DATA)blseesa.dat" RECFM=F LRECL=152;
--------------------------------------------------------------*/
filename ascifile "%sysget(DATASRC_DATA)blseesa.dat" RECFM=F LRECL=152;
proc datasource filetype=blseesa
infile=ascifile
outall=totkey
out=totemp;
keep sa1;
range from 1989:3 to 1990:3;
rename sa1=totemp;
run;
title1 'Information on Total Employment, OUTALL= Data Set';
proc print data=totkey;
run;
title1 'Total Employment, OUT= Data Set';
proc print data=totemp;
run;
filename datafile "%sysget(DATASRC_DATA)blseesa.dat" RECFM=F LRECL=152;
proc datasource filetype=blseesa
outall=totkey
out=totemp;
where industry='0000';
keep sa1;
range from 1989:3 to 1990:3;
rename sa1=totemp;
run;
title1 'Total Employment for Real Estate and Construction, OUT= Data Set';
proc print data=totemp;
run;