#!/bin/csh
## by Jean Roth, jroth@nber.org , 2010-02-18

set dataDir = "/homes/data/cps-basic/smpbff2.dsd.census.gov/pub/cps/basic/201001-/"
foreach year (10)
   `rm -f /home/data/morg/raw/morg$year`
   `touch /home/data/morg/raw/morg$year`
   foreach mon ( jan feb mar apr may jun jul aug sep oct nov dec )
   #foreach mon ( jan )
      set suffix = "pub.dat.Z"
      set dataFile = "$dataDir$mon$year$suffix"
      `zcat $dataFile | awk 'substr($0,64,1) == 4 || substr($0,64,1) == 8' >>/home/data/morg/raw/morg$year `;

   end
end

`compress /home/data/morg/raw/morg$year`
