*libname exemp3 'c:\documents and settings\gillian raab\my documents\aprojects\peas\web\exemp3\data\' ; libname exemp3 'j:\depts\fhls\peas\ex3datafiles\data' ; proc format library = exemp3; value agegroup /* Age of respondent in this qu aire. The f */ 16-19='16-19' 25-29='25-29' 35-39='35-39' 45-49='45-49' 55-59='55-59' 65-69='65-69' 70-74='70-74' 60-64='60-64' 50-54='50-54' 40-44='40-44' 30-34='30-34' 20-24='20-24' ; value cigstA /* (D) Cigarette Smoking Status - Never/Ex-reg/Ex-occ/Current */ -9 = 'Refused/Not answered' -8 = 'Don''t know' -6 = 'schedule not obtained' -1 = 'not applicable' 1 = 'Never smoked cigarettes at all' 2 = 'Used to smoke cigarettes occasionally' 3 = 'Used to smoke cigarettes regularly' 4 = 'Current cigarette smoker' ; value cigstB /* (D) Cigarette Smoking Status - Banded current smokers */ -9 = 'Refused/Not answered' -8 = 'Don''t know' -6 = 'schedule not obtained' -1 = 'not applicable' 1 = 'Light smokers, under 10 a day' 2 = 'Moderate smokers, 10 to under 20 a day' 3 = 'Heavy smokers, 20 or more a day' 4 = 'Don''t know number smoked a day' 5 = 'Non-smoker' ; value region /* HEALTH BOARD */ 1 = 'Highlands & Islands' 2 = 'Grampian & Tayside' 3 = 'Lothian & Fife' 4 = 'Borders, Dumfries & Galloway' 5 = 'Glagow' 6 = 'Lanarkshire,Ayrshire & Arran' 7 = 'Forth Valley, Argyll & Clyde' ; value hboard /* Health Board */ 101 = 'Ayreshire & Arran' 102 = 'Borders' 103 = 'Argyll & Clyde' 104 = 'Fife' 105 = 'Greater Glasgow' 106 = 'Highland' 107 = 'Lanarkshire' 108 = 'Grampian' 109 = 'Orkney' 110 = 'Lothian' 111 = 'Tayside' 112 = 'Forth Valley' 113 = 'Western Isles' 114 = 'Dumfries & Galloway' 115 = 'Shetland' ; value sc /* social class (adult respondent) */ -9 = 'Not answered/refused' -8 = 'Don''t know' -6 = 'schedule not obtained' -1 = 'not applicable' ; data ex3; set exemp3.ex3; format age agegroup.; format sex sex.; format region region.; format hboard hboard.; format nofad nofad.; format sc sc.; format cigst1 cigsta.; format cigst2 cigstb. run; proc contents data=exemp3.ex3;* short; run; /*------------------------------------------------ now save without formats so easy to open and set missing values -----------------------------------------------------*/ data exemp3.ex3; set exemp3.ex3; drop nin; *archpt carstair idno nofad psu region ; run;