format oddmult (f1.0).
loop #i=1 to 7.
if ((outdat(#i)-outdat(#i+1) gt 3) and (outdat(#i)-outdat(#i+1) le 273))oddmult=1.
end loop.
* Flag up any NCDS cases with an event prior to March 1991, who took part in the NCDS 5
survey.
* For them we delete this extraneous information, by setting the 'key' variable to 40, so that
blank data is copied into that
* birth slot (we know no-one in NCDS had a birth event in the 40th slot).
* If they weren't interviewed in 1991, we leave the data as it is anyway.
loop #i=1 to 8.
Do if(outdat(#i) gt 0 and (outdat(#i) le yrmoda(1991,03,01)) and (dmpart=1)).
compute key(#i)=40.
compute pre91flg=1.
end if.
end loop.
* Re-arrange all 39 pregnancy history variables so that all the other information about each
outcome is
* in the slot corresponding to the re-arranged birth date. Need first to copy variables to their
v-prefix vectors, use loop
* structure to copy them to their correct position (x-prefix vectors), then copy them back to
their ordinary names from
* the x-prefix vectors.
* Note this process only occurs for cases where we know the outcomes have ben wrongly
bunched in the same pregnancy,
* or where the outcomes are in the wrong chronological order. Even if this is the case, we
don't proceed if there are any
* outcomes with a year entered as '9999', or where we know there are any true multiple births,
or any dubious multiple
* births (i.e. >3 days but less than 9 months apart). All these latter cases are flagged for
manual scrutiny.
compute vpregnu1=pregnum.
compute vpregnu2=pregnum2.
compute vpregnu3=pregnum3.
compute vpregnu4=pregnum4.
compute vpregnu5=pregnum5.
compute vpregnu6=pregnum6.
compute vpregnu7=pregnum7.
compute vpregnu8=pregnum8.
compute vpregj1=pregj.
compute vpregj2=pregj2.
compute vpregj3=pregj3.
compute vpregj4=pregj4.
compute vpregj5=pregj5.
compute vpregj6=pregj6.
compute vpregj7=pregj7.
compute vpregj8=pregj8.
compute vcg1prg1=cgprega1.
compute vcg1prg2=cgprega4.
compute vcg1prg3=cgprega7.
compute vcg1prg4=cgpreg10.
compute vcg1prg5=cgpreg13.