Hello: I've been struggling with importing a the Lab.dat file from NHANES III using the SAS code posted on NHANES web site. However, the unique ID field called SEQN only gets period (.) entered for all the rows. I have tried Best12, Best8, and even Best32 formatting as suggested by some articles I found online to no effect. I'd appreciate help with getting the import done successfully. Some data elements could be missing for other fields but absolutely not for the SEQN (ID) field. Below is the data sample, code and output. The data file has almost 300 fields of which all I need is 13 as shown in the below code: FILENAME LAB "/home/clonyem/NHANES/LAB.DAT" LRECL=1979; *** LRECL includes 2 positions for CRLF, assuming use of PC SAS; DATA LAB; INFILE LAB MISSOVER; LENGTH SEQN 8 DMARETHN 3 DMARACER 3 DMAETHNR 3 HSSEX 3 HSAGEIR 3 HSAITMOR 4 DMPPIR 8 MXPAXTMR 4 CRP 8 CEP 8 CEPSI 8 OSPSI 3 ; FORMAT SEQN BEST12. DMPPIR Z6.3 CRP 8.2 CEP 6.1 CEPSI 8.1 OSPSI 8. ; INPUT SEQN 1-5 DMARETHN 12 DMARACER 13 DMAETHNR 14 HSSEX 15 HSAGEIR 16-17 HSAITMOR 19-22 DMPPIR 34-39 MXPAXTMR 1236-1239 CRP 1667-1671 CEP 1784-1787 CEPSI 1788-1793 OSPSI 1858-1860 ; LABEL SEQN = "Sample person identification number" DMARETHN = "Race-ethnicity" DMARACER = "Race" DMAETHNR = "Ethnicity" HSSEX = "Sex" HSAGEIR = "Age at interview (Screener)" HSAITMOR = "Age in months at interview (screener)" DMPPIR = "Poverty Income Ratio (unimputed income)" MXPAXTMR = "Age in months at MEC exam" CRP = "Serum C-reactive protein (mg/dL)" CEP = "Serum creatinine (mg/dL)" CEPSI = "Serum creatinine: SI (umol/L)" OSPSI = "Serum osmolality: SI (mmol/Kg)" ; proc export data=WORK.LAB outfile = "/home/clonyem/NHANES/LAB.CSV" dbms=csv; run; SEQN data is missing in the output. Warning messages Row one of LAB.DAT data file, similar to the rest of the data rows. Help is much appreciated!
... View more