*options obs=100; options nocenter ; /*------------------------------------------------ by Jean Roth Fri Mar 17 12:00:10 EDT 2006 Report errors to jroth@nber.org This program is distributed under the GNU GPL. See end of this file and http://www.gnu.org/licenses/ for details. HHEXT04 has 77149 observations and 7 variables. FFEXT04 has 87949 observations and 11 variables. PPEXT04 has 213241 observations and 20 variables. ----------------------------------------------- */ * The following line should contain the directory where the hh- , ff- , and ppext04 datasets, the main CPS March 2004 dataset, and where the SAS file is to be stored ; libname library "~/bulk"; * Sorting household dataset by h_seq ; proc sort data = library.hhext04 ; by h_seq ; run; * Renaming fh_seq to h_seq and sorting family dataset by h_seq ffpos ; proc sort data = library.ffext04 ( rename = ( fh_seq=h_seq ) ) ; by h_seq ffpos ; run ; * Renaming ph_seq to h_seq and sorting person dataset by h_seq pppos ; proc sort data = library.ppext04 ( rename = ( ph_seq=h_seq ) ) ; by h_seq pppos ; run ; * Sorting main March dataset merging with household and family data ; proc sort data = library.cpsmar04; by h_seq ffpos ; * Merging household records to main March dataset ; data cpsext04 ; merge library.cpsmar04 ( in = master ) library.hhext04 ( in = using ) ; by h_seq ; * Checking the merge ; if master then do ; hmatch='MAIN' ; end; if using then do ; hmatch='HH' ; end; if master and using then do ; hmatch='BOTH'; end; run; proc freq data = cpsext04 ; tables hmatch ; * Merging family records to main March dataset ; data cpsext04 ; merge cpsext04 ( in = master ) library.ffext04 ( in = using ) ; by h_seq ffpos ; * Checking the merge ; if master then do ; fmatch='MAIN' ; end; if using then do ; fmatch='FF' ; end; if master and using then do ; fmatch='BOTH'; end; run; proc freq data = cpsext04 ; tables fmatch ; * Sorting main March dataset merging with person data ; proc sort data = cpsext04 ; by h_seq pppos ; * Merging person records to main March dataset ; data library.cpsext04 ; merge cpsext04 ( in = master ) library.ppext04 ( in = using ) ; by h_seq pppos ; * Checking the merge ; if master then do ; pmatch='MAIN' ; end; if using then do ; pmatch='PP' ; end; if master and using then do ; pmatch='BOTH'; end; run; proc freq data = library.cpsext04 ; tables pmatch ; /* Copyright 2006 shared by the National Bureau of Economic Research and Jean Roth National Bureau of Economic Research. 1050 Massachusetts Avenue Cambridge, MA 02138 jroth@nber.org This program and all programs referenced in it are free software. You can redistribute the program or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */