Hello everyone,
I would appreciate it if someone can help me out.
I am receiving an error on my code but I do not understanding why. I downloaded a SAS data set in the studio but the error code is telling me that my file is not a SAS data set .
For context I downloaded my life from the CDC website under Data files. https://www.cdc.gov/brfss/annual_data/annual_2020.html
Thanks in advance for helping out, it is for a class assignment.
Hi everyone thanks for all the tips.
Everything is working fine now.
I had to left click on my downloaded zip file and chose '' Extract All".
Once the zip file got extracted unto XPT I reload it on the SAS studio and it worked.
I hope this helps whoever else might face the same issue.
What do you see when you inspect the zip file on your PC with Windows Explorer?
The XPORT engine cannot read a ZIP file. Only the original binary file with the 80 byte long records.
So either expand the file inside the ZIP file into a normal file. Then you can use the XPORT engine with the actual file. If you cannot figure out how to UNZIP the file you can use SAS to do it.
filename orig zip '......zip';
filename copy temp ;
data _null_;
infile orig('*') recfm=f lrecl=80;
file copy recfm=f lrecl=80;
input;
put _infile_;
run;
libname transprt xport "%sysfunc(pathname(copy))";
proc copy inlib=transprt outlib=dataout;
run;
Or use a tool like %xport2sas() that can read a transport file from a ZIP file.
filename orig zip '......zip' member='*';
%xport2sas(file=orig,libref=dataout)
PS Which link on that page did you use to find that particular ZIP file? Here is the code that %xport2sas() generated to read the file downloaded from https://www.cdc.gov/brfss/annual_data/2020/files/LLCP2020XPT.zip
Just define the ORIG fileref and the DATAOUT libref and you should be able to run this program without bothering to figure out how to use the %xport2sas() macro.
%if not %sysfunc(cexist(work.formats.xprtflt.infmt)) %then %do;
*------------------------------------------------------------------------;
* Define the XPRTFLT informat to support reading missing numeric values. ;
*------------------------------------------------------------------------;
proc format;
invalue xprtflt
'2E00000000000000'x=.
'4100000000000000'x=.A '4200000000000000'x=.B '4300000000000000'x=.C
'4400000000000000'x=.D '4500000000000000'x=.E '4600000000000000'x=.F
'4700000000000000'x=.G '4800000000000000'x=.H '4900000000000000'x=.I
'4A00000000000000'x=.J '4B00000000000000'x=.K '4C00000000000000'x=.L
'4D00000000000000'x=.M '4E00000000000000'x=.N '4F00000000000000'x=.O
'5000000000000000'x=.P '5100000000000000'x=.Q '5200000000000000'x=.R
'5300000000000000'x=.S '5400000000000000'x=.T '5500000000000000'x=.U
'5600000000000000'x=.V '5700000000000000'x=.W '5800000000000000'x=.X
'5900000000000000'x=.Y '5A00000000000000'x=.Z '5F00000000000000'x=._
other=(|s370frb8.|);
run;
%end;
data dataout.LLCP2020 ;
if _n_>401958 then stop;
infile orig unbuffered recfm=n lrecl=354240;
if _n_=1 then input @39841 @;
length _STATE 8 ;
label _STATE = 'STATE FIPS CODE' ;
length FMONTH 8 ;
label FMONTH = 'FILE MONTH' ;
length IDATE $8 ;
label IDATE = 'INTERVIEW DATE' ;
length IMONTH $2 ;
label IMONTH = 'INTERVIEW MONTH' ;
length IDAY $2 ;
label IDAY = 'INTERVIEW DAY' ;
length IYEAR $4 ;
label IYEAR = 'INTERVIEW YEAR' ;
length DISPCODE 8 ;
label DISPCODE = 'FINAL DISPOSITION' ;
length SEQNO $10 ;
label SEQNO = 'ANNUAL SEQUENCE NUMBER' ;
length _PSU 8 ;
label _PSU = 'PRIMARY SAMPLING UNIT' ;
length CTELENM1 8 ;
label CTELENM1 = 'CORRECT TELEPHONE NUMBER?' ;
length PVTRESD1 8 ;
label PVTRESD1 = 'PRIVATE RESIDENCE?' ;
length COLGHOUS 8 ;
label COLGHOUS = 'DO YOU LIVE IN COLLEGE HOUSING?' ;
length STATERE1 8 ;
label STATERE1 = 'RESIDENT OF STATE' ;
length CELPHONE 8 ;
label CELPHONE = 'CELLULAR TELEPHONE' ;
length LADULT1 8 ;
label LADULT1 = 'ARE YOU 18 YEARS OF AGE OR OLDER?' ;
length COLGSEX 8 ;
label COLGSEX = 'ARE YOU MALE OR FEMALE?' ;
length NUMADULT 8 ;
label NUMADULT = 'NUMBER OF ADULTS IN HOUSEHOLD' ;
length LANDSEX 8 ;
label LANDSEX = 'ARE YOU MALE OR FEMALE?' ;
length NUMMEN 8 ;
label NUMMEN = 'NUMBER OF ADULT MEN IN HOUSEHOLD' ;
length NUMWOMEN 8 ;
label NUMWOMEN = 'NUMBER OF ADULT WOMEN IN HOUSEHOLD' ;
length RESPSLCT 8 ;
label RESPSLCT = 'RESPONDENT SELECTION' ;
length SAFETIME 8 ;
label SAFETIME = 'SAFE TIME TO TALK?' ;
length CTELNUM1 8 ;
label CTELNUM1 = 'CORRECT PHONE NUMBER?' ;
length CELLFON5 8 ;
label CELLFON5 = 'IS THIS A CELL PHONE?' ;
length CADULT1 8 ;
label CADULT1 = 'ARE YOU 18 YEARS OF AGE OR OLDER?' ;
length CELLSEX 8 ;
label CELLSEX = 'ARE YOU MALE OR FEMALE?' ;
length PVTRESD3 8 ;
label PVTRESD3 = 'DO YOU LIVE IN A PRIVATE RESIDENCE?' ;
length CCLGHOUS 8 ;
label CCLGHOUS = 'DO YOU LIVE IN COLLEGE HOUSING?' ;
length CSTATE1 8 ;
label CSTATE1 = 'DO YOU CURRENTLY LIVE IN ____(STATE)___' ;
length LANDLINE 8 ;
label LANDLINE = 'DO YOU ALSO HAVE A LANDLINE TELEPHONE?' ;
length HHADULT 8 ;
label HHADULT = 'NUMBER OF ADULTS IN HOUSEHOLD' ;
length SEXVAR 8 ;
label SEXVAR = 'SEX OF RESPONDENT' ;
length GENHLTH 8 ;
label GENHLTH = 'GENERAL HEALTH' ;
length PHYSHLTH 8 ;
label PHYSHLTH = 'NUMBER OF DAYS PHYSICAL HEALTH NOT GOOD' ;
length MENTHLTH 8 ;
label MENTHLTH = 'NUMBER OF DAYS MENTAL HEALTH NOT GOOD' ;
length POORHLTH 8 ;
label POORHLTH = 'POOR PHYSICAL OR MENTAL HEALTH' ;
length HLTHPLN1 8 ;
label HLTHPLN1 = 'HAVE ANY HEALTH CARE COVERAGE' ;
length PERSDOC2 8 ;
label PERSDOC2 = 'MULTIPLE HEALTH CARE PROFESSIONALS' ;
length MEDCOST 8 ;
label MEDCOST = 'COULD NOT SEE DR. BECAUSE OF COST' ;
length CHECKUP1 8 ;
label CHECKUP1 = 'LENGTH OF TIME SINCE LAST ROUTINE CHECKU' ;
length EXERANY2 8 ;
label EXERANY2 = 'EXERCISE IN PAST 30 DAYS' ;
length SLEPTIM1 8 ;
label SLEPTIM1 = 'HOW MUCH TIME DO YOU SLEEP' ;
length CVDINFR4 8 ;
label CVDINFR4 = 'EVER DIAGNOSED WITH HEART ATTACK' ;
length CVDCRHD4 8 ;
label CVDCRHD4 = 'EVER DIAGNOSED WITH ANGINA OR CORONARY H' ;
length CVDSTRK3 8 ;
label CVDSTRK3 = 'EVER DIAGNOSED WITH A STROKE' ;
length ASTHMA3 8 ;
label ASTHMA3 = 'EVER TOLD HAD ASTHMA' ;
length ASTHNOW 8 ;
label ASTHNOW = 'STILL HAVE ASTHMA' ;
length CHCSCNCR 8 ;
label CHCSCNCR = '(EVER TOLD) YOU HAD SKIN CANCER?' ;
length CHCOCNCR 8 ;
label CHCOCNCR = '(EVER TOLD) YOU HAD ANY OTHER TYPES OF C' ;
length CHCCOPD2 8 ;
label CHCCOPD2 = '(EVER TOLD) YOU HAD (COPD) CHRONIC OBSTR' ;
length HAVARTH4 8 ;
label HAVARTH4 = 'TOLD HAVE ARTHRITIS' ;
length ADDEPEV3 8 ;
label ADDEPEV3 = '(EVER TOLD) YOU HAD A DEPRESSIVE DISORDE' ;
length CHCKDNY2 8 ;
label CHCKDNY2 = 'EVER TOLD YOU HAVE KIDNEY DISEASE?' ;
length DIABETE4 8 ;
label DIABETE4 = '(EVER TOLD) YOU HAD DIABETES' ;
length DIABAGE3 8 ;
label DIABAGE3 = 'AGE WHEN TOLD DIABETES' ;
length LASTDEN4 8 ;
label LASTDEN4 = 'LAST VISITED DENTIST OR DENTAL CLINIC' ;
length RMVTETH4 8 ;
label RMVTETH4 = 'NUMBER OF PERMANENT TEETH REMOVED' ;
length MARITAL 8 ;
label MARITAL = 'MARITAL STATUS' ;
length EDUCA 8 ;
label EDUCA = 'EDUCATION LEVEL' ;
length RENTHOM1 8 ;
label RENTHOM1 = 'OWN OR RENT HOME' ;
length NUMHHOL3 8 ;
label NUMHHOL3 = 'HOUSEHOLD TELEPHONES' ;
length NUMPHON3 8 ;
label NUMPHON3 = 'RESIDENTIAL PHONES' ;
length CPDEMO1B 8 ;
label CPDEMO1B = 'DO YOU HAVE A CELL PHONE FOR PERSONAL US' ;
length VETERAN3 8 ;
label VETERAN3 = 'ARE YOU A VETERAN' ;
length EMPLOY1 8 ;
label EMPLOY1 = 'EMPLOYMENT STATUS' ;
length CHILDREN 8 ;
label CHILDREN = 'NUMBER OF CHILDREN IN HOUSEHOLD' ;
length INCOME2 8 ;
label INCOME2 = 'INCOME LEVEL' ;
length PREGNANT 8 ;
label PREGNANT = 'PREGNANCY STATUS' ;
length WEIGHT2 8 ;
label WEIGHT2 = 'REPORTED WEIGHT IN POUNDS' ;
length HEIGHT3 8 ;
label HEIGHT3 = 'REPORTED HEIGHT IN FEET AND INCHES' ;
length DEAF 8 ;
label DEAF = 'ARE YOU DEAF OR DO YOU HAVE SERIOUS DIFF' ;
length BLIND 8 ;
label BLIND = 'BLIND OR DIFFICULTY SEEING' ;
length DECIDE 8 ;
label DECIDE = 'DIFFICULTY CONCENTRATING OR REMEMBERING' ;
length DIFFWALK 8 ;
label DIFFWALK = 'DIFFICULTY WALKING OR CLIMBING STAIRS' ;
length DIFFDRES 8 ;
label DIFFDRES = 'DIFFICULTY DRESSING OR BATHING' ;
length DIFFALON 8 ;
label DIFFALON = 'DIFFICULTY DOING ERRANDS ALONE' ;
length SMOKE100 8 ;
label SMOKE100 = 'SMOKED AT LEAST 100 CIGARETTES' ;
length SMOKDAY2 8 ;
label SMOKDAY2 = 'FREQUENCY OF DAYS NOW SMOKING' ;
length STOPSMK2 8 ;
label STOPSMK2 = 'STOPPED SMOKING IN PAST 12 MONTHS' ;
length LASTSMK2 8 ;
label LASTSMK2 = 'INTERVAL SINCE LAST SMOKED' ;
length USENOW3 8 ;
label USENOW3 = 'USE OF SMOKELESS TOBACCO PRODUCTS' ;
length ALCDAY5 8 ;
label ALCDAY5 = 'DAYS IN PAST 30 HAD ALCOHOLIC BEVERAGE' ;
length AVEDRNK3 8 ;
label AVEDRNK3 = 'AVG ALCOHOLIC DRINKS PER DAY IN PAST 30' ;
length DRNK3GE5 8 ;
label DRNK3GE5 = 'BINGE DRINKING' ;
length MAXDRNKS 8 ;
label MAXDRNKS = 'MOST DRINKS ON SINGLE OCCASION PAST 30 D' ;
length FLUSHOT7 8 ;
label FLUSHOT7 = 'ADULT FLU SHOT/SPRAY PAST 12 MOS' ;
length FLSHTMY3 8 ;
label FLSHTMY3 = 'WHEN RECEIVED MOST RECENT SEASONAL FLU S' ;
length SHINGLE2 8 ;
label SHINGLE2 = 'HAVE YOU EVER HAD THE SHINGLES OR ZOSTER' ;
length PNEUVAC4 8 ;
label PNEUVAC4 = 'PNEUMONIA SHOT EVER' ;
length FALL12MN 8 ;
label FALL12MN = 'HAD FALL PAST TWELVE MONTHS' ;
length FALLINJ4 8 ;
label FALLINJ4 = 'INJURED IN FALL' ;
length SEATBELT 8 ;
label SEATBELT = 'HOW OFTEN USE SEATBELTS IN CAR?' ;
length DRNKDRI2 8 ;
label DRNKDRI2 = 'DID YOU DRIVE AFTER HAVING TOO MUCH TO D' ;
length HADMAM 8 ;
label HADMAM = 'HAVE YOU EVER HAD A MAMMOGRAM' ;
length HOWLONG 8 ;
label HOWLONG = 'HOW LONG SINCE LAST MAMMOGRAM' ;
length HADPAP2 8 ;
label HADPAP2 = 'EVER HAD A PAP TEST' ;
length LASTPAP2 8 ;
label LASTPAP2 = 'HOW LONG SINCE LAST PAP TEST' ;
length HPVTEST 8 ;
label HPVTEST = 'HAVE YOU EVER HAD AN HPV TEST?' ;
length HPLSTTST 8 ;
label HPLSTTST = 'HOW LONG SINCE YOUR LAST HPV TEST?' ;
length HADHYST2 8 ;
label HADHYST2 = 'HAD HYSTERECTOMY' ;
length PCPSAAD3 8 ;
label PCPSAAD3 = 'HAS A HEALTH PROFESSIONAL EVER TALKED WI' ;
length PCPSADI1 8 ;
label PCPSADI1 = 'HAS A HEALTH PROFESSIONAL EVER TALKED WI' ;
length PCPSARE1 8 ;
label PCPSARE1 = 'HAS A DOCTOR EVER RECOMMENDED THAT YOU H' ;
length PSATEST1 8 ;
label PSATEST1 = 'EVER HAD PSA TEST' ;
length PSATIME 8 ;
label PSATIME = 'TIME SINCE LAST PSA TEST' ;
length PCPSARS1 8 ;
label PCPSARS1 = 'WHAT WAS THE MAIN REASON YOU HAD THIS PS' ;
length COLNSCPY 8 ;
label COLNSCPY = 'HAVE YOU EVER HAD A COLONOSCOPY?' ;
length COLNTEST 8 ;
label COLNTEST = 'HOW LONG HAS IT BEEN SINCE YOU HAD COLON' ;
length SIGMSCPY 8 ;
label SIGMSCPY = 'HAVE YOU EVER HAD A SIGMOIDOSCOPY?' ;
length SIGMTEST 8 ;
label SIGMTEST = 'HOW LONG HAS IT BEEN SINCE YOU HAD SIGMO' ;
length BLDSTOL1 8 ;
label BLDSTOL1 = 'EVER HAD BLOOD STOOL TEST USING HOME KIT' ;
length LSTBLDS4 8 ;
label LSTBLDS4 = 'HOW LONG SINCE YOU HAD BLOOD STOOL TEST?' ;
length STOOLDNA 8 ;
label STOOLDNA = 'EVER HAD STOOL DNA TEST?' ;
length SDNATEST 8 ;
label SDNATEST = 'HOW LONG SINCE YOU HAD STOOL DNA?' ;
length VIRCOLON 8 ;
label VIRCOLON = 'HAVE YOU EVER HAD A VIRTUAL COLONOSCOPY?' ;
length VCLNTEST 8 ;
label VCLNTEST = 'HOW LONG HAS IT BEEN SINCE YOU HAD VIRTU' ;
length HIVTST7 8 ;
label HIVTST7 = 'EVER TESTED H.I.V.' ;
length HIVTSTD3 8 ;
label HIVTSTD3 = 'MONTH AND YEAR OF LAST HIV TEST' ;
length HIVRISK5 8 ;
label HIVRISK5 = 'DO ANY HIGH RISK SITUATIONS APPLY' ;
length PDIABTST 8 ;
label PDIABTST = 'HAD A TEST FOR HIGH BLOOD SUGAR IN PAST' ;
length PREDIAB1 8 ;
label PREDIAB1 = 'EVER BEEN TOLD YOU HAVE PRE-DIABETES OR' ;
length INSULIN1 8 ;
label INSULIN1 = 'NOW TAKING INSULIN' ;
length BLDSUGAR 8 ;
label BLDSUGAR = 'HOW OFTEN CHECK BLOOD FOR GLUCOSE' ;
length FEETCHK3 8 ;
label FEETCHK3 = 'HOW OFTEN CHECK FEET FOR SORES OR IRRITA' ;
length DOCTDIAB 8 ;
label DOCTDIAB = 'TIMES SEEN HEALTH PROFESSIONAL FOR DIABE' ;
length CHKHEMO3 8 ;
label CHKHEMO3 = 'TIMES CHECKED FOR GLYCOSYLATED HEMOGLOBI' ;
length FEETCHK 8 ;
label FEETCHK = 'TIMES FEET CHECK FOR SORES/IRRITATIONS' ;
length EYEEXAM1 8 ;
label EYEEXAM1 = 'LAST EYE EXAM WHERE PUPILS WERE DILATED' ;
length DIABEYE 8 ;
label DIABEYE = 'EVER TOLD DIABETES HAS AFFECTED EYES' ;
length DIABEDU 8 ;
label DIABEDU = 'EVER TAKEN CLASS IN MANAGING DIABETES' ;
length TOLDCFS 8 ;
label TOLDCFS = 'TOLD HAD CHRONIC FATIGUE SYNDROME OR MYA' ;
length HAVECFS 8 ;
label HAVECFS = 'STILL HAVE CHRONIC FATIGUE SYNDROME OR M' ;
length WORKCFS 8 ;
label WORKCFS = 'HOW MANY HOURS A WEEK ARE YOU BEEN ABLE' ;
length TOLDHEPC 8 ;
label TOLDHEPC = 'TOLD HAD HEPATITIS C' ;
length TRETHEPC 8 ;
label TRETHEPC = 'TREATED FOR HEPATITIS C' ;
length PRIRHEPC 8 ;
label PRIRHEPC = 'WERE YOU TREATED FOR HEPATITIS C PRIOR T' ;
length HAVEHEPC 8 ;
label HAVEHEPC = 'STILL HAVE HEPATITIS C' ;
length HAVEHEPB 8 ;
label HAVEHEPB = 'TOLD HAD HEPATITIS B' ;
length MEDSHEPB 8 ;
label MEDSHEPB = 'CURRENTLY TAKING MEDICINE FOR HEPATITIS' ;
length HLTHCVR1 8 ;
label HLTHCVR1 = 'PRIMARY HEALTH INSURANCE COVERAGE' ;
length CIMEMLOS 8 ;
label CIMEMLOS = 'HAVE YOU EXPERIENCED CONFUSION OR MEMORY' ;
length CDHOUSE 8 ;
label CDHOUSE = 'GIVEN UP DAY-TO-DAY CHORES DUE TO CONFUS' ;
length CDASSIST 8 ;
label CDASSIST = 'NEED ASSISTANCE WITH DAY-TO_DAY ACTIVITI' ;
length CDHELP 8 ;
label CDHELP = 'WHEN YOU NEED HELP WITH DAY-TO-DAY ACTIV' ;
length CDSOCIAL 8 ;
label CDSOCIAL = 'DOES CONFUSION OR MEMORY LOSS INTERFERE' ;
length CDDISCUS 8 ;
label CDDISCUS = 'HAVE YOU DISCUSSED YOUR CONFUSION OR MEM' ;
length CAREGIV1 8 ;
label CAREGIV1 = 'PROVIDED REGULAR CARE FOR FAMILY OR FRIE' ;
length CRGVREL4 8 ;
label CRGVREL4 = 'RELATIONSHIP OF PERSON TO WHOM YOU ARE G' ;
length CRGVLNG1 8 ;
label CRGVLNG1 = 'HOW LONG PROVIDED CARE FOR PERSON.' ;
length CRGVHRS1 8 ;
label CRGVHRS1 = 'HOW MANY HOURS DO YOU PROVIDE CARE FOR P' ;
length CRGVPRB3 8 ;
label CRGVPRB3 = 'WHAT IS THE MAJOR HEALTH PROBLEM, ILLNES' ;
length CRGVALZD 8 ;
label CRGVALZD = 'DOES PERSON BEING CARED FOR HAVE ALZHEIM' ;
length CRGVPER1 8 ;
label CRGVPER1 = 'MANAGED PERSONAL CARE' ;
length CRGVHOU1 8 ;
label CRGVHOU1 = 'MANAGED HOUSEHOLD TASKS' ;
length CRGVEXPT 8 ;
label CRGVEXPT = 'DO YOU EXPECT TO HAVE A RELATIVE YOU WIL' ;
length ECIGARET 8 ;
label ECIGARET = 'HAVE YOU EVER USED AN E-CIGARETTE OR OTH' ;
length ECIGNOW 8 ;
label ECIGNOW = 'DO YOU NOW USE E-CIGARETTES, EVERY DAY,' ;
length MARIJAN1 8 ;
label MARIJAN1 = 'DURING THE PAST 30 DAYS, ON HOW MANY DAY' ;
length USEMRJN2 8 ;
label USEMRJN2 = 'DURING THE PAST 30 DAYS, HOW DID YOU PRI' ;
length RSNMRJN1 8 ;
label RSNMRJN1 = 'WHAT WAS THE REASON YOU USED MARIJUANA?' ;
length LCSFIRST 8 ;
label LCSFIRST = 'HOW OLD WHEN YOU FIRST STARTED SMOKING?' ;
length LCSLAST 8 ;
label LCSLAST = 'HOW OLD WHEN YOU LAST SMOKED?' ;
length LCSNUMCG 8 ;
label LCSNUMCG = 'ON AVERAGE, HOW MANY CIGARETTES DO YOU S' ;
length LCSCTSCN 8 ;
label LCSCTSCN = 'DID YOU HAVE A CT OR CAT SCAN?' ;
length CNCRDIFF 8 ;
label CNCRDIFF = 'HOW MANY TYPES OF CANCER?' ;
length CNCRAGE 8 ;
label CNCRAGE = 'AGE TOLD HAD CANCER' ;
length CNCRTYP1 8 ;
label CNCRTYP1 = 'TYPE OF CANCER' ;
length CSRVTRT3 8 ;
label CSRVTRT3 = 'CURRENTLY RECEIVING TREATMENT FOR CANCER' ;
length CSRVDOC1 8 ;
label CSRVDOC1 = 'WHAT TYPE OF DOCTOR PROVIDES MAJORITY OF' ;
length CSRVSUM 8 ;
label CSRVSUM = 'DID YOU RECEIVE A SUMMARY OF CANCER TREA' ;
length CSRVRTRN 8 ;
label CSRVRTRN = 'EVER RECEIVE INSTRUCTIONS FROM A DOCTOR' ;
length CSRVINST 8 ;
label CSRVINST = 'INSTRUCTIONS WRITTEN OR PRINTED' ;
length CSRVINSR 8 ;
label CSRVINSR = 'DID HEALTH INSURANCE PAY FOR ALL OF YOUR' ;
length CSRVDEIN 8 ;
label CSRVDEIN = 'EVER DENIED INSURANCE COVERAGE BECAUSE O' ;
length CSRVCLIN 8 ;
label CSRVCLIN = 'PARTICIPATE IN CLINICAL TRIAL AS PART OF' ;
length CSRVPAIN 8 ;
label CSRVPAIN = 'CURRENTLY HAVE PHYSICAL PAIN FROM CANCER' ;
length CSRVCTL2 8 ;
label CSRVCTL2 = 'IS PAIN UNDER CONTROL?' ;
length PCPSADE1 8 ;
label PCPSADE1 = 'WHY WAS PSA TEST DONE?' ;
length PCDMDEC1 8 ;
label PCDMDEC1 = 'WHO MADE THE DECISION WITH YOU TO HAVE P' ;
length HPVADVC4 8 ;
label HPVADVC4 = 'EVER HAD AN H.P.V. VACCINATION?' ;
length HPVADSHT 8 ;
label HPVADSHT = 'NUMBER OF HPV SHOTS RECEIVED' ;
length TETANUS1 8 ;
label TETANUS1 = 'RECEIVED TETANUS SHOT SINCE 2005?' ;
length IMFVPLA1 8 ;
label IMFVPLA1 = 'WHERE DID YOU GET YOUR LAST FLU SHOT/VAC' ;
length BIRTHSEX 8 ;
label BIRTHSEX = 'ARE YOU MALE OR FEMALE?' ;
length SOMALE 8 ;
label SOMALE = 'SEXUAL ORIENTATION' ;
length SOFEMALE 8 ;
label SOFEMALE = 'SEXUAL ORIENTATION' ;
length TRNSGNDR 8 ;
label TRNSGNDR = 'DO YOU CONSIDER YOURSELF TO BE TRANSGEND' ;
length ACEDEPRS 8 ;
label ACEDEPRS = 'LIVE WITH ANYONE DEPRESSED, MENTALLY ILL' ;
length ACEDRINK 8 ;
label ACEDRINK = 'LIVE WITH A PROBLEM DRINKER/ALCOHOLIC?' ;
length ACEDRUGS 8 ;
label ACEDRUGS = 'LIVE WITH ANYONE WHO USED ILLEGAL DRUGS' ;
length ACEPRISN 8 ;
label ACEPRISN = 'LIVE WITH ANYONE WHO SERVED TIME IN PRIS' ;
length ACEDIVRC 8 ;
label ACEDIVRC = 'WERE YOUR PARENTS DIVORCED/SEPERATED?' ;
length ACEPUNCH 8 ;
label ACEPUNCH = 'HOW OFTEN DID YOUR PARENTS BEAT EACH OTH' ;
length ACEHURT1 8 ;
label ACEHURT1 = 'HOW OFTEN DID A PARENT PHYSICALLY HURT Y' ;
length ACESWEAR 8 ;
label ACESWEAR = 'HOW OFTEN DID A PARENT SWEAR AT YOU?' ;
length ACETOUCH 8 ;
label ACETOUCH = 'HOW OFTEN DID ANYONE EVER TOUCH YOU SEXU' ;
length ACETTHEM 8 ;
label ACETTHEM = 'HOW OFTEN DID ANYONE MAKE YOU TOUCH THEM' ;
length ACEHVSEX 8 ;
label ACEHVSEX = 'HOW OFTEN DID ANYONE EVER FORCE YOU TO H' ;
length RCSGENDR 8 ;
label RCSGENDR = 'GENDER OF CHILD' ;
length RCSRLTN2 8 ;
label RCSRLTN2 = 'RELATIONSHIP TO CHILD' ;
length CASTHDX2 8 ;
label CASTHDX2 = 'HLTH PRO EVER SAID CHILD HAS ASTHMA' ;
length CASTHNO2 8 ;
label CASTHNO2 = 'CHILD STILL HAVE ASTHMA?' ;
length QSTVER 8 ;
label QSTVER = 'QUESTIONNAIRE VERSION IDENTIFIER' ;
length QSTLANG 8 ;
label QSTLANG = 'LANGUAGE IDENTIFIER' ;
length _METSTAT 8 ;
label _METSTAT = 'METROPOLITAN STATUS' ;
length _URBSTAT 8 ;
label _URBSTAT = 'URBAN/RURAL STATUS' ;
length MSCODE 4 ;
label MSCODE = 'METROPOLITAN STATUS CODE' ;
length _STSTR 8 ;
label _STSTR = 'SAMPLE DESIGN STRATIFICATION VARIABLE' ;
length _STRWT 8 ;
label _STRWT = 'STRATUM WEIGHT' ;
length _RAWRAKE 8 ;
label _RAWRAKE = 'RAW WEIGHTING FACTOR USED IN RAKING' ;
length _WT2RAKE 8 ;
label _WT2RAKE = 'DESIGN WEIGHT USED IN RAKING' ;
length _IMPRACE 8 ;
label _IMPRACE = 'IMPUTED RACE/ETHNICITY VALUE' ;
length _CHISPNC 8 ;
label _CHISPNC = 'CHILD HISPANIC, LATINO/A, OR SPANISH ORI' ;
length _CRACE1 8 ;
label _CRACE1 = 'CHILD NON-HISPANIC RACE INCLUDING MULTIR' ;
length _CPRACE 8 ;
label _CPRACE = 'PREFERRED CHILD RACE CATEGORIES' ;
length _CLLCPWT 8 ;
label _CLLCPWT = 'FINAL CHILD WEIGHT: LAND-LINE AND CELL-P' ;
length _DUALUSE 8 ;
label _DUALUSE = 'DUAL PHONE USE CATEGORIES' ;
length _DUALCOR 8 ;
label _DUALCOR = 'DUAL PHONE USE CORRECTION FACTOR' ;
length _LLCPWT2 8 ;
label _LLCPWT2 = 'TRUNCATED DESIGN WEIGHT USED IN ADULT CO' ;
length _LLCPWT 8 ;
label _LLCPWT = 'FINAL WEIGHT: LAND-LINE AND CELL-PHONE D' ;
length _RFHLTH 8 ;
label _RFHLTH = 'ADULTS WITH GOOD OR BETTER HEALTH' ;
length _PHYS14D 8 ;
label _PHYS14D = 'COMPUTED PHYSICAL HEALTH STATUS' ;
length _MENT14D 8 ;
label _MENT14D = 'COMPUTED MENTAL HEALTH STATUS' ;
length _HCVU651 8 ;
label _HCVU651 = 'RESPONDENTS AGED 18-64 WITH HEALTH CARE' ;
length _TOTINDA 8 ;
label _TOTINDA = 'LEISURE TIME PHYSICAL ACTIVITY CALCULATE' ;
length _MICHD 8 ;
label _MICHD = 'RESPONDENTS THAT HAVE EVER REPORTED HAVI' ;
length _LTASTH1 8 ;
label _LTASTH1 = 'LIFETIME ASTHMA CALCULATED VARIABLE' ;
length _CASTHM1 8 ;
label _CASTHM1 = 'CURRENT ASTHMA CALCULATED VARIABLE' ;
length _ASTHMS1 8 ;
label _ASTHMS1 = 'COMPUTED ASTHMA STATUS' ;
length _DRDXAR2 8 ;
label _DRDXAR2 = 'RESPONDENTS DIAGNOSED WITH ARTHRITIS' ;
length _EXTETH3 8 ;
label _EXTETH3 = 'RISK FACTOR FOR HAVING HAD PERMANENT TEE' ;
length _ALTETH3 8 ;
label _ALTETH3 = 'ADULTS AGED 65+ WHO HAVE HAD ALL THEIR N' ;
length _DENVST3 8 ;
label _DENVST3 = 'ADULTS WHO HAVE VISITED A DENTIST, DENTA' ;
length _PRACE1 8 ;
label _PRACE1 = 'COMPUTED PREFERRED RACE' ;
length _MRACE1 8 ;
label _MRACE1 = 'CALCULATED NON-HISPANIC RACE INCLUDING M' ;
length _HISPANC 8 ;
label _HISPANC = 'HISPANIC, LATINO/A, OR SPANISH ORIGIN CA' ;
length _RACE 8 ;
label _RACE = 'COMPUTED RACE-ETHNICITY GROUPING' ;
length _RACEG21 8 ;
label _RACEG21 = 'COMPUTED NON-HISPANIC WHITES/ALL OTHERS' ;
length _RACEGR3 8 ;
label _RACEGR3 = 'COMPUTED FIVE LEVEL RACE/ETHNICITY CATEG' ;
length _RACEPRV 8 ;
label _RACEPRV = 'COMPUTED RACE GROUPS USED FOR INTERNET P' ;
length _SEX 8 ;
label _SEX = 'CALCULATED SEX VARIABLE' ;
length _AGEG5YR 8 ;
label _AGEG5YR = 'REPORTED AGE IN FIVE-YEAR AGE CATEGORIES' ;
length _AGE65YR 8 ;
label _AGE65YR = 'REPORTED AGE IN TWO AGE GROUPS CALCULATE' ;
length _AGE80 8 ;
label _AGE80 = 'IMPUTED AGE VALUE COLLAPSED ABOVE 80' ;
length _AGE_G 8 ;
label _AGE_G = 'IMPUTED AGE IN SIX GROUPS' ;
length HTIN4 8 ;
label HTIN4 = 'COMPUTED HEIGHT IN INCHES' ;
length HTM4 8 ;
label HTM4 = 'COMPUTED HEIGHT IN METERS' ;
length WTKG3 8 ;
label WTKG3 = 'COMPUTED WEIGHT IN KILOGRAMS' ;
length _BMI5 8 ;
label _BMI5 = 'COMPUTED BODY MASS INDEX' ;
length _BMI5CAT 8 ;
label _BMI5CAT = 'COMPUTED BODY MASS INDEX CATEGORIES' ;
length _RFBMI5 8 ;
label _RFBMI5 = 'OVERWEIGHT OR OBESE CALCULATED VARIABLE' ;
length _CHLDCNT 8 ;
label _CHLDCNT = 'COMPUTED NUMBER OF CHILDREN IN HOUSEHOLD' ;
length _EDUCAG 8 ;
label _EDUCAG = 'COMPUTED LEVEL OF EDUCATION COMPLETED CA' ;
length _INCOMG 8 ;
label _INCOMG = 'COMPUTED INCOME CATEGORIES' ;
length _SMOKER3 8 ;
label _SMOKER3 = 'COMPUTED SMOKING STATUS' ;
length _RFSMOK3 8 ;
label _RFSMOK3 = 'CURRENT SMOKING CALCULATED VARIABLE' ;
length DRNKANY5 8 ;
label DRNKANY5 = 'DRINK ANY ALCOHOLIC BEVERAGES IN PAST 30' ;
length DROCDY3_ 8 ;
label DROCDY3_ = 'COMPUTED DRINK-OCCASIONS-PER-DAY' ;
length _RFBING5 8 ;
label _RFBING5 = 'BINGE DRINKING CALCULATED VARIABLE' ;
length _DRNKWK1 8 ;
label _DRNKWK1 = 'COMPUTED NUMBER OF DRINKS OF ALCOHOL BEV' ;
length _RFDRHV7 8 ;
label _RFDRHV7 = 'HEAVY ALCOHOL CONSUMPTION CALCULATED VA' ;
length _FLSHOT7 8 ;
label _FLSHOT7 = 'FLU SHOT CALCULATED VARIABLE' ;
length _PNEUMO3 8 ;
label _PNEUMO3 = 'PNEUMONIA VACCINATION CALCULATED VARIABL' ;
length _RFSEAT2 8 ;
label _RFSEAT2 = 'ALWAYS OR NEARLY ALWAYS WEAR SEAT BELTS' ;
length _RFSEAT3 8 ;
label _RFSEAT3 = 'ALWAYS WEAR SEAT BELTS' ;
length _DRNKDRV 8 ;
label _DRNKDRV = 'DRINKING AND DRIVING' ;
length _RFMAM22 8 ;
label _RFMAM22 = 'WOMEN RESPONDENTS AGED 40+ WHO HAVE HAD' ;
length _MAM5023 8 ;
label _MAM5023 = 'WOMEN RESPONDENTS AGED 50-74 WHO HAVE HA' ;
length _RFPAP35 8 ;
label _RFPAP35 = 'WOMEN RESPONDENTS AGED 21-65 WHO HAVE HA' ;
length _RFPSA23 8 ;
label _RFPSA23 = 'MALE RESPONDENTS AGED 40+ WHO HAVE HAD A' ;
length _CLNSCPY 8 ;
label _CLNSCPY = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A CO' ;
length _SGMSCPY 8 ;
label _SGMSCPY = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A SI' ;
length _SGMS10Y 8 ;
label _SGMS10Y = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A SI' ;
length _RFBLDS4 8 ;
label _RFBLDS4 = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A BL' ;
length _STOLDNA 8 ;
label _STOLDNA = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A ST' ;
length _VIRCOLN 8 ;
label _VIRCOLN = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A VI' ;
length _SBONTIM 8 ;
label _SBONTIM = 'RESPONDENTS AGED 50-75 WHO HAVE HAD A SI' ;
length _CRCREC1 8 ;
label _CRCREC1 = 'RESPONDENTS AGED 50-75 WHO HAVE FULLY ME' ;
length _AIDTST4 8 ;
label _AIDTST4 = 'EVER BEEN TESTED FOR HIV CALCULATED VARI' ;
/* INPUT STATEMENT START */
input
_STATE xprtflt8.
FMONTH xprtflt8.
IDATE $ascii8.
IMONTH $ascii2.
IDAY $ascii2.
IYEAR $ascii4.
DISPCODE xprtflt8.
SEQNO $ascii10.
_PSU xprtflt8.
CTELENM1 xprtflt8.
PVTRESD1 xprtflt8.
COLGHOUS xprtflt8.
STATERE1 xprtflt8.
CELPHONE xprtflt8.
LADULT1 xprtflt8.
COLGSEX xprtflt8.
NUMADULT xprtflt8.
LANDSEX xprtflt8.
NUMMEN xprtflt8.
NUMWOMEN xprtflt8.
RESPSLCT xprtflt8.
SAFETIME xprtflt8.
CTELNUM1 xprtflt8.
CELLFON5 xprtflt8.
CADULT1 xprtflt8.
CELLSEX xprtflt8.
PVTRESD3 xprtflt8.
CCLGHOUS xprtflt8.
CSTATE1 xprtflt8.
LANDLINE xprtflt8.
HHADULT xprtflt8.
SEXVAR xprtflt8.
GENHLTH xprtflt8.
PHYSHLTH xprtflt8.
MENTHLTH xprtflt8.
POORHLTH xprtflt8.
HLTHPLN1 xprtflt8.
PERSDOC2 xprtflt8.
MEDCOST xprtflt8.
CHECKUP1 xprtflt8.
EXERANY2 xprtflt8.
SLEPTIM1 xprtflt8.
CVDINFR4 xprtflt8.
CVDCRHD4 xprtflt8.
CVDSTRK3 xprtflt8.
ASTHMA3 xprtflt8.
ASTHNOW xprtflt8.
CHCSCNCR xprtflt8.
CHCOCNCR xprtflt8.
CHCCOPD2 xprtflt8.
HAVARTH4 xprtflt8.
ADDEPEV3 xprtflt8.
CHCKDNY2 xprtflt8.
DIABETE4 xprtflt8.
DIABAGE3 xprtflt8.
LASTDEN4 xprtflt8.
RMVTETH4 xprtflt8.
MARITAL xprtflt8.
EDUCA xprtflt8.
RENTHOM1 xprtflt8.
NUMHHOL3 xprtflt8.
NUMPHON3 xprtflt8.
CPDEMO1B xprtflt8.
VETERAN3 xprtflt8.
EMPLOY1 xprtflt8.
CHILDREN xprtflt8.
INCOME2 xprtflt8.
PREGNANT xprtflt8.
WEIGHT2 xprtflt8.
HEIGHT3 xprtflt8.
DEAF xprtflt8.
BLIND xprtflt8.
DECIDE xprtflt8.
DIFFWALK xprtflt8.
DIFFDRES xprtflt8.
DIFFALON xprtflt8.
SMOKE100 xprtflt8.
SMOKDAY2 xprtflt8.
STOPSMK2 xprtflt8.
LASTSMK2 xprtflt8.
USENOW3 xprtflt8.
ALCDAY5 xprtflt8.
AVEDRNK3 xprtflt8.
DRNK3GE5 xprtflt8.
MAXDRNKS xprtflt8.
FLUSHOT7 xprtflt8.
FLSHTMY3 xprtflt8.
SHINGLE2 xprtflt8.
PNEUVAC4 xprtflt8.
FALL12MN xprtflt8.
FALLINJ4 xprtflt8.
SEATBELT xprtflt8.
DRNKDRI2 xprtflt8.
HADMAM xprtflt8.
HOWLONG xprtflt8.
HADPAP2 xprtflt8.
LASTPAP2 xprtflt8.
HPVTEST xprtflt8.
HPLSTTST xprtflt8.
HADHYST2 xprtflt8.
PCPSAAD3 xprtflt8.
PCPSADI1 xprtflt8.
PCPSARE1 xprtflt8.
PSATEST1 xprtflt8.
PSATIME xprtflt8.
PCPSARS1 xprtflt8.
COLNSCPY xprtflt8.
COLNTEST xprtflt8.
SIGMSCPY xprtflt8.
SIGMTEST xprtflt8.
BLDSTOL1 xprtflt8.
LSTBLDS4 xprtflt8.
STOOLDNA xprtflt8.
SDNATEST xprtflt8.
VIRCOLON xprtflt8.
VCLNTEST xprtflt8.
HIVTST7 xprtflt8.
HIVTSTD3 xprtflt8.
HIVRISK5 xprtflt8.
PDIABTST xprtflt8.
PREDIAB1 xprtflt8.
INSULIN1 xprtflt8.
BLDSUGAR xprtflt8.
FEETCHK3 xprtflt8.
DOCTDIAB xprtflt8.
CHKHEMO3 xprtflt8.
FEETCHK xprtflt8.
EYEEXAM1 xprtflt8.
DIABEYE xprtflt8.
DIABEDU xprtflt8.
TOLDCFS xprtflt8.
HAVECFS xprtflt8.
WORKCFS xprtflt8.
TOLDHEPC xprtflt8.
TRETHEPC xprtflt8.
PRIRHEPC xprtflt8.
HAVEHEPC xprtflt8.
HAVEHEPB xprtflt8.
MEDSHEPB xprtflt8.
HLTHCVR1 xprtflt8.
CIMEMLOS xprtflt8.
CDHOUSE xprtflt8.
CDASSIST xprtflt8.
CDHELP xprtflt8.
CDSOCIAL xprtflt8.
CDDISCUS xprtflt8.
CAREGIV1 xprtflt8.
CRGVREL4 xprtflt8.
CRGVLNG1 xprtflt8.
CRGVHRS1 xprtflt8.
CRGVPRB3 xprtflt8.
CRGVALZD xprtflt8.
CRGVPER1 xprtflt8.
CRGVHOU1 xprtflt8.
CRGVEXPT xprtflt8.
ECIGARET xprtflt8.
ECIGNOW xprtflt8.
MARIJAN1 xprtflt8.
USEMRJN2 xprtflt8.
RSNMRJN1 xprtflt8.
LCSFIRST xprtflt8.
LCSLAST xprtflt8.
LCSNUMCG xprtflt8.
LCSCTSCN xprtflt8.
CNCRDIFF xprtflt8.
CNCRAGE xprtflt8.
CNCRTYP1 xprtflt8.
CSRVTRT3 xprtflt8.
CSRVDOC1 xprtflt8.
CSRVSUM xprtflt8.
CSRVRTRN xprtflt8.
CSRVINST xprtflt8.
CSRVINSR xprtflt8.
CSRVDEIN xprtflt8.
CSRVCLIN xprtflt8.
CSRVPAIN xprtflt8.
CSRVCTL2 xprtflt8.
PCPSADE1 xprtflt8.
PCDMDEC1 xprtflt8.
HPVADVC4 xprtflt8.
HPVADSHT xprtflt8.
TETANUS1 xprtflt8.
IMFVPLA1 xprtflt8.
BIRTHSEX xprtflt8.
SOMALE xprtflt8.
SOFEMALE xprtflt8.
TRNSGNDR xprtflt8.
ACEDEPRS xprtflt8.
ACEDRINK xprtflt8.
ACEDRUGS xprtflt8.
ACEPRISN xprtflt8.
ACEDIVRC xprtflt8.
ACEPUNCH xprtflt8.
ACEHURT1 xprtflt8.
ACESWEAR xprtflt8.
ACETOUCH xprtflt8.
ACETTHEM xprtflt8.
ACEHVSEX xprtflt8.
RCSGENDR xprtflt8.
RCSRLTN2 xprtflt8.
CASTHDX2 xprtflt8.
CASTHNO2 xprtflt8.
QSTVER xprtflt8.
QSTLANG xprtflt8.
_METSTAT xprtflt8.
_URBSTAT xprtflt8.
MSCODE xprtflt4.
_STSTR xprtflt8.
_STRWT xprtflt8.
_RAWRAKE xprtflt8.
_WT2RAKE xprtflt8.
_IMPRACE xprtflt8.
_CHISPNC xprtflt8.
_CRACE1 xprtflt8.
_CPRACE xprtflt8.
_CLLCPWT xprtflt8.
_DUALUSE xprtflt8.
_DUALCOR xprtflt8.
_LLCPWT2 xprtflt8.
_LLCPWT xprtflt8.
_RFHLTH xprtflt8.
_PHYS14D xprtflt8.
_MENT14D xprtflt8.
_HCVU651 xprtflt8.
_TOTINDA xprtflt8.
_MICHD xprtflt8.
_LTASTH1 xprtflt8.
_CASTHM1 xprtflt8.
_ASTHMS1 xprtflt8.
_DRDXAR2 xprtflt8.
_EXTETH3 xprtflt8.
_ALTETH3 xprtflt8.
_DENVST3 xprtflt8.
_PRACE1 xprtflt8.
_MRACE1 xprtflt8.
_HISPANC xprtflt8.
_RACE xprtflt8.
_RACEG21 xprtflt8.
_RACEGR3 xprtflt8.
_RACEPRV xprtflt8.
_SEX xprtflt8.
_AGEG5YR xprtflt8.
_AGE65YR xprtflt8.
_AGE80 xprtflt8.
_AGE_G xprtflt8.
HTIN4 xprtflt8.
HTM4 xprtflt8.
WTKG3 xprtflt8.
_BMI5 xprtflt8.
_BMI5CAT xprtflt8.
_RFBMI5 xprtflt8.
_CHLDCNT xprtflt8.
_EDUCAG xprtflt8.
_INCOMG xprtflt8.
_SMOKER3 xprtflt8.
_RFSMOK3 xprtflt8.
DRNKANY5 xprtflt8.
DROCDY3_ xprtflt8.
_RFBING5 xprtflt8.
_DRNKWK1 xprtflt8.
_RFDRHV7 xprtflt8.
_FLSHOT7 xprtflt8.
_PNEUMO3 xprtflt8.
_RFSEAT2 xprtflt8.
_RFSEAT3 xprtflt8.
_DRNKDRV xprtflt8.
_RFMAM22 xprtflt8.
_MAM5023 xprtflt8.
_RFPAP35 xprtflt8.
_RFPSA23 xprtflt8.
_CLNSCPY xprtflt8.
_SGMSCPY xprtflt8.
_SGMS10Y xprtflt8.
_RFBLDS4 xprtflt8.
_STOLDNA xprtflt8.
_VIRCOLN xprtflt8.
_SBONTIM xprtflt8.
_CRCREC1 xprtflt8.
_AIDTST4 xprtflt8.
@@;
/* INPUT STATEMENT END */
run;
Hello Tom,
Thanks for such an elaborate answer. I will be sure to try them out.
For what little it may be worth, I would download the ASCII text file as it is smaller than the transport file, and the SAS programs to read the data and create and attach formats to the variables.
But then I've only been working with BRFSS data since 1997...
Hi everyone thanks for all the tips.
Everything is working fine now.
I had to left click on my downloaded zip file and chose '' Extract All".
Once the zip file got extracted unto XPT I reload it on the SAS studio and it worked.
I hope this helps whoever else might face the same issue.
Once you know the inner structure of the ZIP archive, you can define a FILENAME to it with the ZIP engine, and then access the XPT file as a member of it, achieving everything in one step.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.