**** * FILE NAME: MMSA13_SASOUT.SAS * * DESCRIPTION: THIS PROGRAM CONVERTS A STATES ASCII DATAFILE OF COMPLETES LOCATED AT * * FILEREF, INTO A SAS DATABASE STORED AT LIBREF * * REFERENCES: * * INPUT DATAIN FILEREF OF ASCII DATAFILE OF COMPLETES * * FORMATS FORMAT13.SAS7BCAT SAS FORMATS DATABASE * * OUTPUT DATAOUT.SASDATA SAS DATABASE VERSION OF ASCII DATA AS SPECIFIED IN * * FILEREF * * UPDATED - 10/05/2016 * ****; ** * Clear Output and Log Windows * **; DM OUTPUT 'clear' continue; DM LOG 'clear' continue; **** * DEFINE SAS ENVIRONMENT OPTIONS * ****; OPTIONS PAGENO=1 NOFMTERR; **** * CLEAR EXISTING TITLES AND FOOTNOTES * ****; TITLE ; FOOTNOTE ; RUN ; * * INSTRUCTIONS: * * SPECIFY PATH OF WHERE ASCII DATAFILE IS STORED * * SPECIFY PATH OF WHERE SAS DATASET IS TO BE STORED * * SPECIFY PATH OF WHERE SAS FORMAT LIBRARY IS STORED * * SPECIFY PATH OF WHERE THE FORMAT ASSIGNMET STATEMENT IS STORED * *; *FILENAME DATAIN '' LRECL = 375 ; ** * EXAMPLE: * * FILENAME DATAIN 'C:\BRFSS\2013\MMSA13.ASC' LRECL = 375 * * NOTE: MAKE SURE THE ASTERISK IS REMOVED BEFORE THE WORD FILENAME AND * * MAKE SURE THAT THE GREATER THAN AND LESS THAN SIGNS < > ARE REMOVED * * FROM THE FILENAME STATEMENT * **; *LIBNAME DATAOUT '' ; ** * EXAMPLE: * * LIBNAME DATAOUT 'C:\' * * A SAS DATABASE WILL BE STORED AT C:\SASDATA.SAS7BDAT * * NOTE: MAKE SURE THE ASTERISK IS REMOVED BEFORE THE WORD LIBNAME AND * * MAKE SURE THAT THE GREATER THAN AND LESS THAN SIGNS < > ARE REMOVED * * FROM THE LIBNAME STATEMENT * **; *LIBNAME LIBRARY '' ; ** * EXAMPLE: * * LIBNAME LIBRARY 'C:\' * * NOTE: MAKE SURE THE ASTERISK IS REMOVED BEFORE THE WORD LIBNAME AND * * MAKE SURE THAT THE GREATER THAN AND LESS THAN SIGNS < > ARE REMOVED * * FROM THE LIBNAME STATEMENT * **; *FILENAME FORMATIN '' ; ** * EXAMPLE: * * FILENAME FORMATIN 'C:\FORMATSTATEMENT.SAS' * * NOTE: MAKE SURE THE ASTERISK IS REMOVED BEFORE THE WORD FILENAME AND * * MAKE SURE THAT THE GREATER THAN AND LESS THAN SIGNS < > ARE REMOVED * * FROM THE FILENAME STATEMENT * **; DATA DATAOUT.SASDATA ; INFILE DATAIN MISSOVER ; INPUT DISPCODE 1-4 SEQNO 5-14 GENHLTH 15 /* Section 1: Health Status */ PHYSHLTH 16-17 /* Section 2: Healthy Days - Health-Related Quality of Life */ MENTHLTH 18-19 POORHLTH 20-21 HLTHPLN1 22 /* Section 3: Health Care Access */ PERSDOC2 23 MEDCOST 24 CHECKUP1 25 SLEPTIM1 26-27 /* Section 4: Inadequate Sleep */ BPHIGH4 28 /* Section 5: Hypertension Awareness */ BPMEDS 29 BLOODCHO 30 /* Section 6: Cholesterol Awareness */ CHOLCHK 31 TOLDHI2 32 CVDINFR4 33 /* Section 7: Chronic Health Conditions */ CVDCRHD4 34 CVDSTRK3 35 ASTHMA3 36 ASTHNOW 37 CHCSCNCR 38 CHCOCNCR 39 CHCCOPD1 40 HAVARTH3 41 ADDEPEV2 42 CHCKIDNY 43 DIABETE3 44 VETERAN3 45 MARITAL 46 CHILDREN 47-48 EDUCA 49 EMPLOY1 50 INCOME2 51-52 WEIGHT2 53-56 HEIGHT3 57-60 NUMHHOL2 61 NUMPHON2 62 INTERNET 63 RENTHOM1 64 SEX 65 PREGNANT 66 QLACTLM2 67 USEEQUIP 68 BLIND 69 DECIDE 70 DIFFWALK 71 DIFFDRES 72 DIFFALON 73 SMOKE100 74 /* Section 9: Tobacco Use */ SMOKDAY2 75 STOPSMK2 76 LASTSMK2 77-78 USENOW3 79 ALCDAY5 80-82 /* Section 10: Alcohol Consumption */ AVEDRNK2 83-84 DRNK3GE5 85-86 MAXDRNKS 87-88 FRUITJU1 89-91 /* Section 11: Fruits & Vegetables */ FRUIT1 92-94 FVBEANS 95-97 FVGREEN 98-100 FVORANG 101-103 VEGETAB1 104-106 EXERANY2 107 /* Section 12: Exercise (Physical Activity) */ EXRACT11 108-109 EXEROFT1 110-112 EXERHMM1 113-115 EXRACT21 116-117 EXEROFT2 118-120 EXERHMM2 121-123 STRENGTH 124-126 LMTJOIN3 127 /* Section 13: Arthritis Burden */ ARTHDIS2 128 ARTHSOCL 129 JOINPAIN 130-131 SEATBELT 132 /* Section 14: Seatbelt Use */ FLUSHOT6 133 /* Section 15: Immunization */ FLSHTMY2 134-139 TETANUS 140 PNEUVAC3 141 HIVTST6 142 /* Section 16: HIV/AIDS */ HIVTSTD3 143-148 WHRTST10 149-150 LANDLINE 151 _STSTR 152-157 _RFHLTH 158 /* Section 1: Calculated Variables */ _HCVU651 159 /* Section 3: Calculated Variables */ _RFHYPE5 160 /* Section 5: Calculated Variables */ _CHOLCHK 161 /* Section 6: Calculated Variables */ _RFCHOL 162 _LTASTH1 163 /* Section 7: Calculated Variables */ _CASTHM1 164 _ASTHMS1 165 _DRDXAR1 166 _PRACE1 167-168 _MRACE1 169-170 _HISPANC 171 _RACE 172 _RACEG21 173 _RACEGR3 174 _AGEG5YR 175-176 _AGE65YR 177 _AGE_G 178 WTKG3 179-183 _BMI5 184-187 _BMI5CAT 188 _RFBMI5 189 _EDUCAG 190 _INCOMG 191 _SMOKER3 192 /* Section 9: Calculated Variables */ _RFSMOK3 193 DRNKANY5 194 /* Section 10: Calculated Variables */ _RFBING5 195 _DRNKDY4 196-199 _DRNKMO4 200-203 _RFDRHV4 204 _RFDRMN4 205 _RFDRWM4 206 _MISFRTN 207 _MISVEGN 208 _FRTRESP 209 _VEGRESP 210 _FRUTSUM 211-216 _VEGESUM 217-222 _FRTLT1 223 _VEGLT1 224 _FRT16 225 _VEG23 226 _FRUITEX 227 _VEGETEX 228 _FRTLT1 229 _VEGLT1 230 _TOTINDA 231 /* Section 12: Calculated Variables */ _MINAC11 232-236 _MINAC21 237-241 _PACAT1 242 _PAINDX1 243 _PA150R2 244 _PA300R2 245 _PA30021 246 _PASTRNG 247 _PAREC1 248 _PASTAE1 249 _LMTACT1 250 /* Section 13: Calculated Variables */ _LMTWRK1 251 _LMTSCL1 252 _RFSEAT2 253 /* Section 14: Calculated Variables */ _RFSEAT3 254 _FLSHOT6 255 /* Section 15: Calculated Variables */ _PNEUMO2 256 _AIDTST3 257 /* Section 16: Calculated Variables */ _AGE80 258-259 _MMSAWT 260-269 /* MMSA Weighting and Stratification Variables */ MMSANAME $270-369 /* MMSA Weighting and Stratification Variables */ _MMSA 370-374 /* MMSA Weighting and Stratification Variables */ ENDOFREC 375 /* End of Record Marker */ ; * TO INCLUDE THE FORMAT ASSIGNEMT STATEMENT REMOVE THE ASTERISK * * FROM THE BEGINNING OF THE FOLLOWING LINE * ; * %INCLUDE FORMATIN ; **** * THIS SECTION CREATES LABELS FOR THE VARIABLES * ****; Label DISPCODE = 'FINAL DISPOSITION' GENHLTH = 'GENERAL HEALTH' PHYSHLTH = 'NUMBER OF DAYS PHYSICAL HEALTH NOT GOOD' MENTHLTH = 'NUMBER OF DAYS MENTAL HEALTH NOT GOOD' POORHLTH = 'POOR PHYSICAL OR MENTAL HEALTH' HLTHPLN1 = 'HAVE ANY HEALTH CARE COVERAGE' PERSDOC2 = 'MULTIPLE HEALTH CARE PROFESSIONALS' MEDCOST = 'COULD NOT SEE DR. BECAUSE OF COST' CHECKUP1 = 'LENGTH OF TIME SINCE LAST ROUTINE CHECKUP' SLEPTIM1 = 'HOW MUCH TIME DO YOU SLEEP' BPHIGH4 = 'EVER TOLD BLOOD PRESSURE HIGH' BPMEDS = 'CURRENTLY TAKING BLOOD PRESSURE MEDICATION' BLOODCHO = 'EVER HAD BLOOD CHOLESTEROL CHECKED' CHOLCHK = 'HOW LONG SINCE CHOLESTEROL CHECKED' TOLDHI2 = 'EVER TOLD BLOOD CHOLESTEROL HIGH' CVDINFR4 = 'EVER DIAGNOSED WITH HEART ATTACK' CVDCRHD4 = 'EVER DIAGNOSED WITH ANGINA OR CORONARY HEART DISEASE' CVDSTRK3 = 'EVER DIAGNOSED WITH A STROKE' ASTHMA3 = 'EVER TOLD HAD ASTHMA' ASTHNOW = 'STILL HAVE ASTHMA' CHCSCNCR = '(EVER TOLD) YOU HAD SKIN CANCER?' CHCOCNCR = '(EVER TOLD) YOU HAD ANY OTHER TYPES OF CANCER?' CHCCOPD1 = '(EVER TOLD) YOU HAVE (COPD) CHRONIC OBSTRUCTIVE PULMONARY DISEASE, EMPHYSEMA OR CHRONIC BRONCHITIS?' HAVARTH3 = 'TOLD HAVE ARTHRITIS' ADDEPEV2 = 'EVER TOLD YOU HAD A DEPRESSIVE DISORDER' CHCKIDNY = '(EVER TOLD) YOU HAVE KIDNEY DISEASE?' DIABETE3 = '(EVER TOLD) YOU HAVE DIABETES' VETERAN3 = 'ARE YOU A VETERAN' MARITAL = 'MARITAL STATUS' CHILDREN = 'NUMBER OF CHILDREN IN HOUSEHOLD' EDUCA = 'EDUCATION LEVEL' EMPLOY1 = 'EMPLOYMENT STATUS' INCOME2 = 'INCOME LEVEL' WEIGHT2 = 'REPORTED WEIGHT IN POUNDS' HEIGHT3 = 'REPORTED HEIGHT IN FEET AND INCHES' NUMHHOL2 = 'HOUSEHOLD TELEPHONES' NUMPHON2 = 'RESIDENTIAL PHONES' INTERNET = 'INTERNET USE IN THE PAST 30 DAYS?' RENTHOM1 = 'OWN OR RENT HOME' SEX = 'RESPONDENTS SEX' PREGNANT = 'PREGNANCY STATUS' QLACTLM2 = 'ACTIVITY LIMITATION DUE TO HEALTH PROBLEMS' USEEQUIP = 'HEALTH PROBLEMS REQUIRING SPECIAL EQUIPMENT' BLIND = 'BLIND OR DIFFICULTY SEEING' DECIDE = 'DIFFICULTY CONCENTRATING OR REMEMBERING' DIFFWALK = 'DIFFICULTY WALKING OR CLIMBING STAIRS' DIFFDRES = 'DIFFICULTY DRESSING OR BATHING' DIFFALON = 'DIFFICULTY DOING ERRANDS ALONE' SMOKE100 = 'SMOKED AT LEAST 100 CIGARETTES' SMOKDAY2 = 'FREQUENCY OF DAYS NOW SMOKING' STOPSMK2 = 'STOPPED SMOKING IN PAST 12 MONTHS' LASTSMK2 = 'INTERVAL SINCE LAST SMOKED' USENOW3 = 'USE OF SMOKELESS TOBACCO PRODUCTS' ALCDAY5 = 'DAYS IN PAST 30 HAD ALCOHOLIC BEVERAGE' AVEDRNK2 = 'AVG ALCOHOLIC DRINKS PER DAY IN PAST 30' DRNK3GE5 = 'BINGE DRINKING' MAXDRNKS = 'MOST DRINKS ON SINGLE OCCASION PAST 30 DAYS' FRUITJU1 = 'HOW MANY TIMES DID YOU DRINK 100 PERCENT PURE FRUIT JUICES?' FRUIT1 = 'HOW MANY TIMES DID YOU EAT FRUIT?' FVBEANS = 'HOW MANY TIMES DID YOU EAT BEANS OR LENTILS?' FVGREEN = 'HOW MANY TIMES DID YOU EAT DARK GREEN VEGETABLES?' FVORANG = 'HOW MANY TIMES DID YOU EAT ORANGE-COLORED VEGETABLES?' VEGETAB1 = 'HOW MANY TIMES DID YOU EAT OTHER VEGETABLES?' EXERANY2 = 'EXERCISE IN PAST 30 DAYS' EXRACT11 = 'TYPE OF PHYSICAL ACTIVITY' EXEROFT1 = 'HOW MANY TIMES WALKING, RUNNING, JOGGING, OR SWIMMING' EXERHMM1 = 'MINUTES OR HOURS WALKING, RUNNING, JOGGING, OR SWIMMING' EXRACT21 = 'OTHER TYPE OF PHYSICAL ACTIVITY GIVING MOST EXERCISE DURING PAST MONTH' EXEROFT2 = 'HOW MANY TIMES WALKING, RUNNING, JOGGING, OR SWIMMING' EXERHMM2 = 'MINUTES OR HOURS WALKING, RUNNING, JOGGING, OR SWIMMING' STRENGTH = 'HOW MANY TIMES DID YOU DO PHYSICAL ACTIVITIES OR EXERCISES TO STRENGTHEN YOUR MUSCLES?' LMTJOIN3 = 'LIMITED BECAUSE OF JOINT SYMPTOMS' ARTHDIS2 = 'DOES ARTHRITIS AFFECT WHETHER YOU WORK' ARTHSOCL = 'SOCIAL ACTIVITIES LIMITED BECAUSE OF JOINT SYMPTOMS' JOINPAIN = 'HOW BAD WAS JOINT PAIN' SEATBELT = 'HOW OFTEN USE SEATBELTS IN CAR?' FLUSHOT6 = 'ADULT FLU SHOT/SPRAY PAST 12 MOS' FLSHTMY2 = 'WHEN RECEIVED MOST RECENT SEASONAL FLU SHOT/SPRAY' TETANUS = 'RECEIVED TETANUS SHOT SINCE 2005?' PNEUVAC3 = 'PNEUMONIA SHOT EVER' HIVTST6 = 'EVER TESTED HIV' HIVTSTD3 = 'MONTH AND YEAR OF LAST HIV TEST' WHRTST10 = 'LOCATION OF LAST HIV TEST' LANDLINE = 'DO YOU ALSO HAVE A LANDLINE TELEPHONE?' _STSTR = 'SAMPLE DESIGN STRATIFICATION VARIABLE' _RFHLTH = 'ADULTS WITH GOOD OR BETTER HEALTH' _HCVU651 = 'RESPONDENTS AGED 18-64 WITH HEALTH CARE COVERAGE' _RFHYPE5 = 'HIGH BLOOD PRESSURE CALCULATED VARIABLE' _CHOLCHK = 'CHOLESTEROL CHECKED CALCULATED VARIABLE' _RFCHOL = 'HIGH CHOLESTEROL CALCULATED VARIABLE' _LTASTH1 = 'LIFETIME ASTHMA CALCULATED VARIABLE' _CASTHM1 = 'CURRENT ASTHMA CALCULATED VARIABLE' _ASTHMS1 = 'COMPUTED ASTHMA STATUS' _DRDXAR1 = 'RESPONDENTS DIAGNOSED WITH ARTHRITIS' _PRACE1 = 'COMPUTED PREFERRED RACE' _MRACE1 = 'CALCULATED NON-HISPANIC RACE INCLUDING MULTIRACIAL' _HISPANC = 'HISPANIC, LATINO/A, OR SPANISH ORIGIN CALCULATED VARIABLE' _RACE = 'COMPUTED RACE-ETHNICITY GROUPING' _RACEG21 = 'COMPUTED NON-HISPANIC WHITES/ALL OTHERS RACE CATEGORIES RACE/ETHNIC GROUP CODES USED IN POST-STRATIF' _RACEGR3 = 'COMPUTED FIVE LEVEL RACE/ETHNICITY CATEGORY.' _AGEG5YR = 'REPORTED AGE IN FIVE-YEAR AGE CATEGORIES CALCULATED VARIABLE' _AGE65YR = 'REPORTED AGE IN TWO AGE GROUPS CALCULATED VARIABLE' _AGE_G = 'IMPUTED AGE IN SIX GROUPS' WTKG3 = 'COMPUTED WEIGHT IN KILOGRAMS' _BMI5 = 'COMPUTED BODY MASS INDEX' _BMI5CAT = 'COMPUTED BODY MASS INDEX CATEGORIES' _RFBMI5 = 'OVERWEIGHT OR OBESE CALCULATED VARIABLE' _EDUCAG = 'COMPUTED LEVEL OF EDUCATION COMPLETED CATEGORIES' _INCOMG = 'COMPUTED INCOME CATEGORIES' _SMOKER3 = 'COMPUTED SMOKING STATUS' _RFSMOK3 = 'CURRENT SMOKING CALCULATED VARIABLE' DRNKANY5 = 'DRINK ANY ALCOHOLIC BEVERAGES IN PAST 30 DAYS' _RFBING5 = 'BINGE DRINKING CALCULATED VARIABLE' _DRNKDY4 = 'COMPUTED NUMBER OF DRINKS OF ALCOHOL BEVERAGES PER DAY' _DRNKMO4 = 'COMPUTED TOTAL NUMBER DRINKS A MONTH' _RFDRHV4 = 'HEAVY ALCOHOL CONSUMPTION CALCULATED VARIABLE' _RFDRMN4 = 'ADULT MEN HEAVY ALCOHOL CONSUMPTION CALCULATED VARIABLE' _RFDRWM4 = 'ADULT WOMEN HEAVY ALCOHOL CONSUMPTION CALCULATED VARIABLE' _MISFRTN = 'THE NUMBER OF MISSING FRUIT RESPONSES' _MISVEGN = 'THE NUMBER OF MISSING VEGETABLE RESPONSES' _FRTRESP = 'MISSING ANY FRUIT RESPONSES' _VEGRESP = 'MISSING ANY VEGETABLE RESPONSES' _FRUTSUM = 'TOTAL FRUITS CONSUMED PER DAY' _VEGESUM = 'TOTAL VEGETABLES CONSUMED PER DAY' _FRTLT1 = 'CONSUME FRUIT 1 OR MORE TIMES PER DAY' _VEGLT1 = 'CONSUME VEGETABLES 1 OR MORE TIMES PER DAY' _FRT16 = 'REPORTED CONSUMING FRUIT >16/DAY' _VEG23 = 'REPORTED CONSUMING VEGETABLES >23/DAY' _FRUITEX = 'FRUIT EXCLUSION FROM ANALYSES' _VEGETEX = 'VEGETABLE EXCLUSION FROM ANALYSES' _TOTINDA = 'LEISURE TIME PHYSICAL ACTIVITY CALCULATED VARIABLE' _MINAC11 = 'MINUTES OF PHYSICAL ACTIVITY PER WEEK FOR FIRST ACTIVITY' _MINAC21 = 'MINUTES OF PHYSICAL ACTIVITY PER WEEK FOR SECOND ACTIVITY' _PACAT1 = 'PHYSICAL ACTIVITY CATEGORIES' _PAINDX1 = 'PHYSICAL ACTIVITY INDEX' _PA150R2 = '150 MINUTE PHYSICAL ACTIVITY CALCULATED VARIABLE' _PA300R2 = '300 MINUTE PHYSICAL ACTIVITY CALCULATED VARIABLE' _PA30021 = '300 MINUTE PHYSICAL ACTIVITY 2-LEVEL CALCULATED VARIABLE' _PASTRNG = 'MUSCLE STRENGTHENING RECOMMENDATION' _PAREC1 = 'AEROBIC AND STRENGTHENING GUIDELINE' _PASTAE1 = 'AEROBIC AND STRENGTHENING (2-LEVEL)' _LMTACT1 = 'LIMITED USUAL ACTIVITIES' _LMTWRK1 = 'LIMITED WORK ACTIVITIES' _LMTSCL1 = 'LIMITED SOCIAL ACTIVITIES' _RFSEAT2 = 'ALWAYS OR NEARLY ALWAYS WEAR SEAT BELTS' _RFSEAT3 = 'ALWAYS WEAR SEAT BELTS' _FLSHOT6 = 'FLU SHOT CALCULATED VARIABLE' _PNEUMO2 = 'PNEUMONIA VACCINATION CALCULATED VARIABLE' _AIDTST3 = 'EVER BEEN TESTED FOR HIV CALCULATED VARIABLE' _AGE80 = ' ' _MMSA = 'MMSA CODE (CBSA OR METRO)' _MMSAWT = 'MMSA-LEVEL WEIGHT' SEQNO = 'SEQUENCE NUMBER' ; RUN;