*options obs=100 ; options nocenter ; **------------------------------------------------; ** by Jean Roth Wed Nov 3 15:33:37 EDT 2010 ** This program reads the 2004 SIPP12 Longitudnal Weight Data File ; ** Report errors to jroth@nber.org ; ** A value of -1 (or -1/# of implied decimals) indicates 'Not in Universe' ; ** This program is distributed under the GNU GPL. ; ** See end of this file and ** http://www.gnu.org/licenses/ for details. ; **-----------------------------------------------; * The following line should contain the directory where the SAS file is to be stored ; libname library "."; * The following line should contain the complete path and name of the raw data file. On a PC, use backslashes in paths as in C:\ ; FILENAME datafile pipe "unzip -p /homes/data/sipp/2004/lgtwgt2004w12.zip "; * The following line should contain the name of the SAS dataset ; %let dataset = sipplgtwgt2004w12 ; DATA library.&dataset ; INFILE datafile LRECL = 20000 ; ** ------------------------------------------------ ; ** The following variable names have been changed, ; ** if necessary: '$' to 'd', '-' to '_', '%' to 'p' ; ** ----------------------------------------------- ; attrib lgtkey length=$8 label="PE: Person longitudinal key"; attrib spanel length=4 label="SU: Sample Code - Indicates Panel Year"; attrib ssuid length=$12 label="SU: Sample Unit Identifier"; attrib epppnum length=$4 label="PE: Person number"; attrib lgtpnwt1 length=8 label="WW: Longitudinal Panel Weight"; attrib lgtpnwt2 length=8 label="WW: Longitudinal Panel Weight"; attrib lgtpnwt3 length=8 label="WW: Longitudinal Panel Weight"; attrib lgtpnwt4 length=8 label="WW: Longitudinal Panel Weight"; attrib lgtcy1wt length=8 label="WW: Longitudinal First Calendar Year Weight"; attrib lgtcy2wt length=8 label="WW: Longitudinal Second Calendar Year Weight"; attrib lgtcy3wt length=8 label="WW: Longitudinal Third Calendar Year Weight"; attrib lgtcy4wt length=8 label="WW: Longitudinal Fourth Calendar Year Weight"; INPUT @1 lgtkey $8. @9 spanel 4. @13 ssuid $12. @25 epppnum $4. @29 lgtpnwt1 10.4 @39 lgtpnwt2 10.4 @49 lgtpnwt3 10.4 @59 lgtpnwt4 10.4 @69 lgtcy1wt 10.4 @79 lgtcy2wt 10.4 @89 lgtcy3wt 10.4 @99 lgtcy4wt 10.4 ; **------------------------------------------------; ** The PROC FORMAT statement will store the formats ; ** in a sas data set called fsipplgtwgt2004w12 ; ** To use the stored formats in a subsequent program, ; ** use code like the following; ** proc format cntlin=library.fspplgtwgt2004w12; ** PROC freq; ** tables pesex ; ** format pesex P135L.; ** For more information, consult PROC FORMAT in the SAS Procedures Guide ; **-----------------------------------------------; PROC FORMAT cntlout=library.fspplgtwgt2004w12; ; VALUE spanel (default=32) 2004 = "Panel Year" ; proc print data=library.sipplgtwgt2004w12 (obs=6); FORMAT spanel spanel. ; proc contents data=library.sipplgtwgt2004w12; run; ** Copyright 2010 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. ;