**** * FILE NAME: MMSA20_SASOUT.SAS * * DESCRIPTION: THIS PROGRAM CONVERTS A STATES ASCII DATAFILE OF COMPLETES LOCATED A T * * FILEREF, INTO A SAS DATABASE STORED AT LIBREF * * REFERENCES: * * INPUT DATAIN FILEREF OF ASCII DATAFILE OF COMPLETES * * FORMATS FORMAT20.SAS7BCAT SAS FORMATS DATABASE * * OUTPUT DATAOUT.SASDATA SAS DATABASE VERSION OF ASCII DATA AS SPECIFIED IN * * FILEREF * * UPDATED - 08/06/2021 * ****; ** * 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 ASSIGNMENT STATEMENT IS STORED * **; *FILENAME DATAIN '' LRECL = 339 ; ** * EXAMPLE: * * FILENAME DATAIN 'C:\BRFSS\2020\MMSA20.ASC' LRECL = 339 * * 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 STATERE1 15 CELPHONE 16 LADULT1 17 COLGSEX 18 LANDSEX 19 RESPSLCT 20 SAFETIME 21 /* Cell Phone Introduction */ CADULT1 22 CELLSEX 23 HHADULT 24-25 SEXVAR 26 /* Respondent Sex */ GENHLTH 27 /* Section 1: Health Status */ PHYSHLTH 28-29 /* Section 2: Healthy Days */ MENTHLTH 30-31 POORHLTH 32-33 HLTHPLN1 34 /* Section 3: Health Care Access */ PERSDOC2 35 MEDCOST 36 CHECKUP1 37 EXERANY2 38 /* Section 4: Exercise */ SLEPTIM1 39-40 /* Section 5: Inadequate Sleep */ CVDINFR4 41 /* Section 6: Chronic Health Conditions */ CVDCRHD4 42 CVDSTRK3 43 ASTHMA3 44 ASTHNOW 45 CHCSCNCR 46 CHCOCNCR 47 CHCCOPD2 48 HAVARTH4 49 ADDEPEV3 50 CHCKDNY2 51 DIABETE4 52 DIABAGE3 53-54 LASTDEN4 55 /* Section 7: Oral Health */ RMVTETH4 56 MARITAL 57 EDUCA 58 RENTHOM1 59 NUMHHOL3 60 NUMPHON3 61 CPDEMO1B 62 VETERAN3 63 EMPLOY1 64 CHILDREN 65-66 INCOME2 67-68 PREGNANT 69 WEIGHT2 70-73 HEIGHT3 74-77 DEAF 78 /* Section 9: Disability */ BLIND 79 DECIDE 80 DIFFWALK 81 DIFFDRES 82 DIFFALON 83 SMOKE100 84 /* Section 10: Tobacco Use */ SMOKDAY2 85 STOPSMK2 86 LASTSMK2 87-88 USENOW3 89 ALCDAY5 90-92 /* Section 11: Alcohol Consumption */ AVEDRNK3 93-94 DRNK3GE5 95-96 MAXDRNKS 97-98 FLUSHOT7 99 /* Section 12: Immunization */ FLSHTMY3 100-105 SHINGLE2 106 PNEUVAC4 107 FALL12MN 108-109 /* Section 13: Falls */ FALLINJ4 110-111 SEATBELT 112 /* Section 14: Seatbelt Use and Drinking and Dr iving */ DRNKDRI2 113-114 HADMAM 115 /* Section 15: Breast and Cervical Cancer Scree ning */ HOWLONG 116 HADPAP2 117 LASTPAP2 118 HPVTEST 119 HPLSTTST 120 HADHYST2 121 PCPSAAD3 122 /* Section 16: Prostate Cancer Screening */ PCPSADI1 123 PCPSARE1 124 PSATEST1 125 PSATIME 126 PCPSARS1 127 COLNSCPY 128 /* Section 17: Colorectal Cancer Screening */ COLNTEST 129 SIGMSCPY 130 SIGMTEST 131 BLDSTOL1 132 LSTBLDS4 133 STOOLDNA 134 SDNATEST 135 VIRCOLON 136 VCLNTEST 137 HIVTST7 138 /* Section 18: HIV/AIDS */ HIVTSTD3 139-144 HIVRISK5 145 _STSTR 146-151 _IMPSEX 152 CAGEG 153 _RFHLTH 154 /* Section 1: Calculated Variables */ _PHYS14D 155 /* Section 2: Calculated Variables */ _MENT14D 156 _HCVU651 157 /* Section 3: Calculated Variables */ _TOTINDA 158 /* Section 4: Calculated Variables */ _MICHD 159 /* Section 6: Calculated Variables */ _LTASTH1 160 _CASTHM1 161 _ASTHMS1 162 _DRDXAR2 163 _EXTETH3 164 /* Section 7: Calculated Variables */ _ALTETH3 165 _DENVST3 166 _PRACE1 167-168 _MRACE1 169-170 _HISPANC 171 _RACE 172 _RACEG21 173 _RACEGR3 174 _RACEPRV 175 _SEX 176 _AGEG5YR 177-178 _AGE65YR 179 _AGE80 180-181 _AGE_G 182 WTKG3 183-187 _BMI5 188-191 _BMI5CAT 192 _RFBMI5 193 _EDUCAG 194 _INCOMG 195 _SMOKER3 196 /* Section 10: Calculated Variables */ _RFSMOK3 197 DRNKANY5 198 /* Section 11: Calculated Variables */ _RFBING5 199 _DRNKWK1 200-204 _RFDRHV7 205 _FLSHOT7 206 /* Section 12: Calculated Variables */ _PNEUMO3 207 _RFSEAT2 208 /* Section 14: Calculated Variables */ _RFSEAT3 209 _DRNKDRV 210 _RFMAM22 211 /* Section 15: Calculated Variables */ _MAM5023 212 _RFPAP35 213 _RFPSA23 214 /* Section 16: Calculated Variables */ _CLNSCPY 215 /* Section 17: Calculated Variables */ _SGMSCPY 216 _SGMS10Y 217 _RFBLDS4 218 _STOLDNA 219 _VIRCOLN 220 _SBONTIM 221 _CRCREC1 222 _AIDTST4 223 /* Section 18: Calculated Variables */ _MMSAWT 224-233 /* MMSA Weighting and Stratification Variables */ MMSANAME $234-333 /* MMSA Weighting and Stratification Variables */ _MMSA 334-338 /* MMSA Weighting and Stratification Variables */ ENDOFREC 339 /* 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' STATERE1 = 'RESIDENT OF STATE' CELPHONE = 'CELLULAR TELEPHONE' LADULT1 = 'ARE YOU 18 YEARS OF AGE OR OLDER?' COLGSEX = 'ARE YOU MALE OR FEMALE?' LANDSEX = 'ARE YOU MALE OR FEMALE?' RESPSLCT = 'RESPONDENT SELECTION' SAFETIME = 'SAFE TIME TO TALK?' CADULT1 = 'ARE YOU 18 YEARS OF AGE OR OLDER?' CELLSEX = 'ARE YOU MALE OR FEMALE?' HHADULT = 'NUMBER OF ADULTS IN HOUSEHOLD' SEXVAR = 'SEX OF RESPONDENT' 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' EXERANY2 = 'EXERCISE IN PAST 30 DAYS' SLEPTIM1 = 'HOW MUCH TIME DO YOU SLEEP' 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?' CHCCOPD2 = '(EVER TOLD) YOU HAD (COPD) CHRONIC OBSTRUCTIVE PULMONARY DISEASE, EMPHYSE MA OR CHRONIC BRONCHITIS?' HAVARTH4 = 'TOLD HAVE ARTHRITIS' ADDEPEV3 = '(EVER TOLD) YOU HAD A DEPRESSIVE DISORDER' CHCKDNY2 = 'EVER TOLD YOU HAVE KIDNEY DISEASE?' DIABETE4 = '(EVER TOLD) YOU HAD DIABETES' DIABAGE3 = 'AGE WHEN TOLD DIABETES' LASTDEN4 = 'LAST VISITED DENTIST OR DENTAL CLINIC' RMVTETH4 = 'NUMBER OF PERMANENT TEETH REMOVED' MARITAL = 'MARITAL STATUS' EDUCA = 'EDUCATION LEVEL' RENTHOM1 = 'OWN OR RENT HOME' NUMHHOL3 = 'HOUSEHOLD TELEPHONES' NUMPHON3 = 'RESIDENTIAL PHONES' CPDEMO1B = 'DO YOU HAVE A CELL PHONE FOR PERSONAL USE?' VETERAN3 = 'ARE YOU A VETERAN' EMPLOY1 = 'EMPLOYMENT STATUS' CHILDREN = 'NUMBER OF CHILDREN IN HOUSEHOLD' INCOME2 = 'INCOME LEVEL' PREGNANT = 'PREGNANCY STATUS' WEIGHT2 = 'REPORTED WEIGHT IN POUNDS' HEIGHT3 = 'REPORTED HEIGHT IN FEET AND INCHES' DEAF = 'ARE YOU DEAF OR DO YOU HAVE SERIOUS DIFFICULTY HEARING?' 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' AVEDRNK3 = 'AVG ALCOHOLIC DRINKS PER DAY IN PAST 30' DRNK3GE5 = 'BINGE DRINKING' MAXDRNKS = 'MOST DRINKS ON SINGLE OCCASION PAST 30 DAYS' FLUSHOT7 = 'ADULT FLU SHOT/SPRAY PAST 12 MOS' FLSHTMY3 = 'WHEN RECEIVED MOST RECENT SEASONAL FLU SHOT/SPRAY' SHINGLE2 = 'HAVE YOU EVER HAD THE SHINGLES OR ZOSTER VACCINE?' PNEUVAC4 = 'PNEUMONIA SHOT EVER' FALL12MN = 'HAD FALL PAST TWELVE MONTHS' FALLINJ4 = 'INJURED IN FALL' SEATBELT = 'HOW OFTEN USE SEATBELTS IN CAR?' DRNKDRI2 = 'DID YOU DRIVE AFTER HAVING TOO MUCH TO DRINK IN THE PAST 30 DAYS?' HADMAM = 'HAVE YOU EVER HAD A MAMMOGRAM' HOWLONG = 'HOW LONG SINCE LAST MAMMOGRAM' HADPAP2 = 'EVER HAD A PAP TEST' LASTPAP2 = 'HOW LONG SINCE LAST PAP TEST' HPVTEST = 'HAVE YOU EVER HAD AN HPV TEST?' HPLSTTST = 'HOW LONG SINCE YOUR LAST HPV TEST?' HADHYST2 = 'HAD HYSTERECTOMY' PCPSAAD3 = 'HAS A HEALTH PROFESSIONAL EVER TALKED WITH YOU ABOUT THE ADVANTAGES OF TH E PSA TEST?' PCPSADI1 = 'HAS A HEALTH PROFESSIONAL EVER TALKED WITH YOU ABOUT THE DISADVANTAGES OF THE PSA TEST?' PCPSARE1 = 'HAS A DOCTOR EVER RECOMMENDED THAT YOU HAVE A PSA TEST?' PSATEST1 = 'EVER HAD PSA TEST' PSATIME = 'TIME SINCE LAST PSA TEST' PCPSARS1 = 'WHAT WAS THE MAIN REASON YOU HAD THIS PSA TEST?' COLNSCPY = 'HAVE YOU EVER HAD A COLONOSCOPY?' COLNTEST = 'HOW LONG HAS IT BEEN SINCE YOU HAD COLONOSCOPY?' SIGMSCPY = 'HAVE YOU EVER HAD A SIGMOIDOSCOPY?' SIGMTEST = 'HOW LONG HAS IT BEEN SINCE YOU HAD SIGMOIDOSCOPY?' BLDSTOL1 = 'EVER HAD BLOOD STOOL TEST USING HOME KIT' LSTBLDS4 = 'HOW LONG SINCE YOU HAD BLOOD STOOL TEST?' STOOLDNA = 'EVER HAD STOOL DNA TEST?' SDNATEST = 'HOW LONG SINCE YOU HAD STOOL DNA?' VIRCOLON = 'HAVE YOU EVER HAD A VIRTUAL COLONOSCOPY?' VCLNTEST = 'HOW LONG HAS IT BEEN SINCE YOU HAD VIRTUAL COLONOSCOPY?' HIVTST7 = 'EVER TESTED H.I.V.' HIVTSTD3 = 'MONTH AND YEAR OF LAST HIV TEST' HIVRISK5 = 'DO ANY HIGH RISK SITUATIONS APPLY' _STSTR = 'SAMPLE DESIGN STRATIFICATION VARIABLE' _IMPSEX = 'IMPUTED GENDER' CAGEG = 'FOUR LEVEL CHILD AGE' _RFHLTH = 'ADULTS WITH GOOD OR BETTER HEALTH' _PHYS14D = 'COMPUTED PHYSICAL HEALTH STATUS' _MENT14D = 'COMPUTED MENTAL HEALTH STATUS' _HCVU651 = 'RESPONDENTS AGED 18-64 WITH HEALTH CARE COVERAGE' _TOTINDA = 'LEISURE TIME PHYSICAL ACTIVITY CALCULATED VARIABLE' _MICHD = 'RESPONDENTS THAT HAVE EVER REPORTED HAVING CORONARY HEART DISEASE (CHD) OR MYOCARDIAL INFARCTION (MI' _LTASTH1 = 'LIFETIME ASTHMA CALCULATED VARIABLE' _CASTHM1 = 'CURRENT ASTHMA CALCULATED VARIABLE' _ASTHMS1 = 'COMPUTED ASTHMA STATUS' _DRDXAR2 = 'RESPONDENTS DIAGNOSED WITH ARTHRITIS' _EXTETH3 = 'RISK FACTOR FOR HAVING HAD PERMANENT TEETH EXTRACTED' _ALTETH3 = 'ADULTS AGED 65+ WHO HAVE HAD ALL THEIR NATURAL TEETH EXTRACTED' _DENVST3 = 'ADULTS WHO HAVE VISITED A DENTIST, DENTAL HYGENIST OR DENTAL CLINIC WITHI N THE PAST YEAR' _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.' _RACEPRV = 'COMPUTED RACE GROUPS USED FOR INTERNET PREVALENCE TABLES' _SEX = 'CALCULATED SEX VARIABLE' _AGEG5YR = 'REPORTED AGE IN FIVE-YEAR AGE CATEGORIES CALCULATED VARIABLE' _AGE65YR = 'REPORTED AGE IN TWO AGE GROUPS CALCULATED VARIABLE' _AGE80 = 'IMPUTED AGE VALUE COLLAPSED ABOVE 80' _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' _DRNKWK1 = 'COMPUTED NUMBER OF DRINKS OF ALCOHOL BEVERAGES PER WEEK' _RFDRHV7 = 'HEAVY ALCOHOL CONSUMPTION CALCULATED VARIABLE' _FLSHOT7 = 'FLU SHOT CALCULATED VARIABLE' _PNEUMO3 = 'PNEUMONIA VACCINATION CALCULATED VARIABLE' _RFSEAT2 = 'ALWAYS OR NEARLY ALWAYS WEAR SEAT BELTS' _RFSEAT3 = 'ALWAYS WEAR SEAT BELTS' _DRNKDRV = 'DRINKING AND DRIVING' _RFMAM22 = 'WOMEN RESPONDENTS AGED 40+ WHO HAVE HAD A MAMMOGRAM IN THE PAST TWO YEARS ' _MAM5023 = 'WOMEN RESPONDENTS AGED 50-74 WHO HAVE HAD A MAMMOGRAM IN THE PAST TWO YEA RS' _RFPAP35 = 'WOMEN RESPONDENTS AGED 21-65 WHO HAVE HAD A PAP TEST IN THE PAST THREE YE ARS' _RFPSA23 = 'MALE RESPONDENTS AGED 40+ WHO HAVE HAD A PSA TEST IN THE PAST 2 YEARS' _CLNSCPY = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A COLONOSCOPY WITHIN THE PAST TEN YEA RS' _SGMSCPY = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A SIGMOIDOSCOPY WITHIN THE PAST FIVE YEARS' _SGMS10Y = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A SIGMOIDOSCOPY WITHIN THE PAST TEN Y EARS' _RFBLDS4 = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A BLOOD STOOL TEST WITHIN THE PAST YE AR' _STOLDNA = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A STOOL DNA TEST WITHIN THE PAST THRE E YEARS' _VIRCOLN = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A VIRTUAL COLONOSCOPY WITHIN THE PAST FIVE YEARS' _SBONTIM = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A SIGMOIDOSCOPY WITHIN THE PAST TEN Y EARS AND A BLOOD STOOL TEST' _CRCREC1 = 'RESPONDENTS AGED 50-75 WHO HAVE FULLY MET THE USPSTF RECOMMENDATIONS' _AIDTST4 = 'EVER BEEN TESTED FOR HIV CALCULATED VARIABLE' _MMSA = 'MMSA CODE (CBSA OR METRO)' _MMSAWT = 'MMSA-LEVEL WEIGHT' SEQNO = 'SEQUENCE NUMBER' ; RUN;