SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
And08863
Fluorite | Level 6

Hello,

 

I downloaded a dataset from IPUMS and have had great difficulty in uploading it into SAS University Edition. It was provided as a .dat file and I was given SAS code to import it but it hasn't worked. I've attached a screenshot of the filepath in my computer (so you know I've already put it in its shared folder!) and pasted the provided code from IPUMS to upload it. 

 

And08863_0-1606778877181.png

The .dat file does not have any delimiters, it is simply pasted as one long run of numbers and each participant information is seperated by an enter. Two example lines are pasted here: 

2019201901006897202019010000012000000110020190068972013300000011012740001000000110011000000110200120009999999012000000000000000000000000002513351359
2019201901006897212019010000014000000230020190068972113300000011022740001000000230011000000330100120009999999000000120000000000000000000000000000000

 

/*
   NOTE: You need to edit the `libname` command to specify the path to the directory
   where the data file is located. For example: "C:\ipums_directory".
   Edit the `filename` command similarly to include the full path (the directory and the data file name).
*/

libname IPUMS ".";
filename ASCIIDAT "usa_00002.dat";

proc format cntlout = IPUMS.usa_00002_f;

value YEAR_f
  1850 = "1850"
  1860 = "1860"
  1870 = "1870"
  1880 = "1880"
  1900 = "1900"
  1910 = "1910"
  1920 = "1920"
  1930 = "1930"
  1940 = "1940"
  1950 = "1950"
  1960 = "1960"
  1970 = "1970"
  1980 = "1980"
  1990 = "1990"
  2000 = "2000"
  2001 = "2001"
  2002 = "2002"
  2003 = "2003"
  2004 = "2004"
  2005 = "2005"
  2006 = "2006"
  2007 = "2007"
  2008 = "2008"
  2009 = "2009"
  2010 = "2010"
  2011 = "2011"
  2012 = "2012"
  2013 = "2013"
  2014 = "2014"
  2015 = "2015"
  2016 = "2016"
  2017 = "2017"
  2018 = "2018"
  2019 = "2019"
;

value SAMPLE_f
  201902 = "2019 PRCS"
  201901 = "2019 ACS"
  201804 = "2014-2018, PRCS 5-year"
  201803 = "2014-2018, ACS 5-year"
  201802 = "2018 PRCS"
  201801 = "2018 ACS"
  201704 = "2013-2017, PRCS 5-year"
  201703 = "2013-2017, ACS 5-year"
  201702 = "2017 PRCS"
  201701 = "2017 ACS"
  201604 = "2012-2016, PRCS 5-year"
  201603 = "2012-2016, ACS 5-year"
  201602 = "2016 PRCS"
  201601 = "2016 ACS"
  201504 = "2011-2015, PRCS 5-year"
  201503 = "2011-2015, ACS 5-year"
  201502 = "2015 PRCS"
  201501 = "2015 ACS"
  201404 = "2010-2014, PRCS 5-year"
  201403 = "2010-2014, ACS 5-year"
  201402 = "2014 PRCS"
  201401 = "2014 ACS"
  201306 = "2009-2013, PRCS 5-year"
  201305 = "2009-2013, ACS 5-year"
  201304 = "2011-2013, PRCS 3-year"
  201303 = "2011-2013, ACS 3-year"
  201302 = "2013 PRCS"
  201301 = "2013 ACS"
  201206 = "2008-2012, PRCS 5-year"
  201205 = "2008-2012, ACS 5-year"
  201204 = "2010-2012, PRCS 3-year"
  201203 = "2010-2012, ACS 3-year"
  201202 = "2012 PRCS"
  201201 = "2012 ACS"
  201106 = "2007-2011, PRCS 5-year"
  201105 = "2007-2011, ACS 5-year"
  201104 = "2009-2011, PRCS 3-year"
  201103 = "2009-2011, ACS 3-year"
  201102 = "2011 PRCS"
  201101 = "2011 ACS"
  201008 = "2010 Puerto Rico 10%"
  201007 = "2010 10%"
  201006 = "2006-2010, PRCS 5-year"
  201005 = "2006-2010, ACS 5-year"
  201004 = "2008-2010, PRCS 3-year"
  201003 = "2008-2010, ACS 3-year"
  201002 = "2010 PRCS"
  201001 = "2010 ACS"
  200906 = "2005-2009, PRCS 5-year"
  200905 = "2005-2009, ACS 5-year"
  200904 = "2007-2009, PRCS 3-year"
  200903 = "2007-2009, ACS 3-year"
  200902 = "2009 PRCS"
  200901 = "2009 ACS"
  200804 = "2006-2008, PRCS 3-year"
  200803 = "2006-2008, ACS 3-year"
  200802 = "2008 PRCS"
  200801 = "2008 ACS"
  200704 = "2005-2007, PRCS 3-year"
  200703 = "2005-2007, ACS 3-year"
  200702 = "2007 PRCS"
  200701 = "2007 ACS"
  200602 = "2006 PRCS"
  200601 = "2006 ACS"
  200502 = "2005 PRCS"
  200501 = "2005 ACS"
  200401 = "2004 ACS"
  200301 = "2003 ACS"
  200201 = "2002 ACS"
  200101 = "2001 ACS"
  200008 = "2000 Puerto Rico 1%"
  200007 = "2000 1%"
  200006 = "2000 Puerto Rico 1% sample (old version)"
  200005 = "2000 Puerto Rico 5%"
  200004 = "2000 ACS"
  200003 = "2000 Unweighted 1%"
  200002 = "2000 1% sample (old version)"
  200001 = "2000 5%"
  199007 = "1990 Puerto Rico 1%"
  199006 = "1990 Puerto Rico 5%"
  199005 = "1990 Labor Market Area"
  199004 = "1990 Elderly"
  199003 = "1990 Unweighted 1%"
  199002 = "1990 1%"
  199001 = "1990 5%"
  198007 = "1980 Puerto Rico 1%"
  198006 = "1980 Puerto Rico 5%"
  198005 = "1980 Detailed metro/non-metro"
  198004 = "1980 Labor Market Area"
  198003 = "1980 Urban/Rural"
  198002 = "1980 1%"
  198001 = "1980 5%"
  197009 = "1970 Puerto Rico Neighborhood"
  197008 = "1970 Puerto Rico Municipio"
  197007 = "1970 Puerto Rico State"
  197006 = "1970 Form 2 Neighborhood"
  197005 = "1970 Form 1 Neighborhood"
  197004 = "1970 Form 2 Metro"
  197003 = "1970 Form 1 Metro"
  197002 = "1970 Form 2 State"
  197001 = "1970 Form 1 State"
  196002 = "1960 5%"
  196001 = "1960 1%"
  195001 = "1950 1%"
  194002 = "1940 100% database"
  194001 = "1940 1%"
  193004 = "1930 100% database"
  193003 = "1930 Puerto Rico"
  193002 = "1930 5%"
  193001 = "1930 1%"
  192003 = "1920 100% database"
  192002 = "1920 Puerto Rico sample"
  192001 = "1920 1%"
  191004 = "1910 100% database"
  191003 = "1910 1.4% sample with oversamples"
  191002 = "1910 1%"
  191001 = "1910 Puerto Rico"
  190004 = "1900 100% database"
  190003 = "1900 1% sample with oversamples"
  190002 = "1900 1%"
  190001 = "1900 5%"
  188003 = "1880 100% database"
  188002 = "1880 10%"
  188001 = "1880 1%"
  187003 = "1870 100% database"
  187002 = "1870 1% sample with black oversample"
  187001 = "1870 1%"
  186003 = "1860 100% database"
  186002 = "1860 1% sample with black oversample"
  186001 = "1860 1%"
  185002 = "1850 100% database"
  185001 = "1850 1%"
;

value STATEICP_f
  01 = "Connecticut"
  02 = "Maine"
  03 = "Massachusetts"
  04 = "New Hampshire"
  05 = "Rhode Island"
  06 = "Vermont"
  11 = "Delaware"
  12 = "New Jersey"
  13 = "New York"
  14 = "Pennsylvania"
  21 = "Illinois"
  22 = "Indiana"
  23 = "Michigan"
  24 = "Ohio"
  25 = "Wisconsin"
  31 = "Iowa"
  32 = "Kansas"
  33 = "Minnesota"
  34 = "Missouri"
  35 = "Nebraska"
  36 = "North Dakota"
  37 = "South Dakota"
  40 = "Virginia"
  41 = "Alabama"
  42 = "Arkansas"
  43 = "Florida"
  44 = "Georgia"
  45 = "Louisiana"
  46 = "Mississippi"
  47 = "North Carolina"
  48 = "South Carolina"
  49 = "Texas"
  51 = "Kentucky"
  52 = "Maryland"
  53 = "Oklahoma"
  54 = "Tennessee"
  56 = "West Virginia"
  61 = "Arizona"
  62 = "Colorado"
  63 = "Idaho"
  64 = "Montana"
  65 = "Nevada"
  66 = "New Mexico"
  67 = "Utah"
  68 = "Wyoming"
  71 = "California"
  72 = "Oregon"
  73 = "Washington"
  81 = "Alaska"
  82 = "Hawaii"
  83 = "Puerto Rico"
  96 = "State groupings (1980 Urban/rural sample)"
  97 = "Military/Mil. Reservations"
  98 = "District of Columbia"
  99 = "State not identified"
;

value GQ_f
  0 = "Vacant unit"
  1 = "Households under 1970 definition"
  2 = "Additional households under 1990 definition"
  3 = "Group quarters--Institutions"
  4 = "Other group quarters"
  5 = "Additional households under 2000 definition"
  6 = "Fragment"
;

value RACE_f
  1 = "White"
  2 = "Black/African American/Negro"
  3 = "American Indian or Alaska Native"
  4 = "Chinese"
  5 = "Japanese"
  6 = "Other Asian or Pacific Islander"
  7 = "Other race, nec"
  8 = "Two major races"
  9 = "Three or more major races"
;

value RACED_f
  100 = "White"
  110 = "Spanish write_in"
  120 = "Blank (white) (1850)"
  130 = "Portuguese"
  140 = "Mexican (1930)"
  150 = "Puerto Rican (1910 Hawaii)"
  200 = "Black/African American/Negro"
  210 = "Mulatto"
  300 = "American Indian/Alaska Native"
  302 = "Apache"
  303 = "Blackfoot"
  304 = "Cherokee"
  305 = "Cheyenne"
  306 = "Chickasaw"
  307 = "Chippewa"
  308 = "Choctaw"
  309 = "Comanche"
  310 = "Creek"
  311 = "Crow"
  312 = "Iroquois"
  313 = "Kiowa"
  314 = "Lumbee"
  315 = "Navajo"
  316 = "Osage"
  317 = "Paiute"
  318 = "Pima"
  319 = "Potawatomi"
  320 = "Pueblo"
  321 = "Seminole"
  322 = "Shoshone"
  323 = "Sioux"
  324 = "Tlingit (Tlingit_Haida, 2000/ACS)"
  325 = "Tohono O Odham"
  326 = "All other tribes (1990)"
  328 = "Hopi"
  329 = "Central American Indian"
  330 = "Spanish American Indian"
  350 = "Delaware"
  351 = "Latin American Indian"
  352 = "Puget Sound Salish"
  353 = "Yakama"
  354 = "Yaqui"
  355 = "Colville"
  356 = "Houma"
  357 = "Menominee"
  358 = "Yuman"
  359 = "South American Indian"
  360 = "Mexican American Indian"
  361 = "Other Amer. Indian tribe (2000,ACS)"
  362 = "2+ Amer. Indian tribes (2000,ACS)"
  370 = "Alaskan Athabaskan"
  371 = "Aleut"
  372 = "Eskimo"
  373 = "Alaskan mixed"
  374 = "Inupiat"
  375 = "Yup'ik"
  379 = "Other Alaska Native tribe(s) (2000,ACS)"
  398 = "Both Am. Ind. and Alaska Native (2000,ACS)"
  399 = "Tribe not specified"
  400 = "Chinese"
  410 = "Taiwanese"
  420 = "Chinese and Taiwanese"
  500 = "Japanese"
  600 = "Filipino"
  610 = "Asian Indian (Hindu 1920_1940)"
  620 = "Korean"
  630 = "Hawaiian"
  631 = "Hawaiian and Asian (1900,1920)"
  632 = "Hawaiian and European (1900,1920)"
  634 = "Hawaiian mixed"
  640 = "Vietnamese"
  641 = "Bhutanese"
  642 = "Mongolian"
  643 = "Nepalese"
  650 = "Other Asian or Pacific Islander (1920,1980)"
  651 = "Asian only (CPS)"
  652 = "Pacific Islander only (CPS)"
  653 = "Asian or Pacific Islander, n.s. (1990 Internal Census files)"
  660 = "Cambodian"
  661 = "Hmong"
  662 = "Laotian"
  663 = "Thai"
  664 = "Bangladeshi"
  665 = "Burmese"
  666 = "Indonesian"
  667 = "Malaysian"
  668 = "Okinawan"
  669 = "Pakistani"
  670 = "Sri Lankan"
  671 = "Other Asian, n.e.c."
  672 = "Asian, not specified"
  673 = "Chinese and Japanese"
  674 = "Chinese and Filipino"
  675 = "Chinese and Vietnamese"
  676 = "Chinese and Asian write_in"
  677 = "Japanese and Filipino"
  678 = "Asian Indian and Asian write_in"
  679 = "Other Asian race combinations"
  680 = "Samoan"
  681 = "Tahitian"
  682 = "Tongan"
  683 = "Other Polynesian (1990)"
  684 = "1+ other Polynesian races (2000,ACS)"
  685 = "Guamanian/Chamorro"
  686 = "Northern Mariana Islander"
  687 = "Palauan"
  688 = "Other Micronesian (1990)"
  689 = "1+ other Micronesian races (2000,ACS)"
  690 = "Fijian"
  691 = "Other Melanesian (1990)"
  692 = "1+ other Melanesian races (2000,ACS)"
  698 = "2+ PI races from 2+ PI regions"
  699 = "Pacific Islander, n.s."
  700 = "Other race, n.e.c."
  801 = "White and Black"
  802 = "White and AIAN"
  810 = "White and Asian"
  811 = "White and Chinese"
  812 = "White and Japanese"
  813 = "White and Filipino"
  814 = "White and Asian Indian"
  815 = "White and Korean"
  816 = "White and Vietnamese"
  817 = "White and Asian write_in"
  818 = "White and other Asian race(s)"
  819 = "White and two or more Asian groups"
  820 = "White and PI"
  821 = "White and Native Hawaiian"
  822 = "White and Samoan"
  823 = "White and Guamanian"
  824 = "White and PI write_in"
  825 = "White and other PI race(s)"
  826 = "White and other race write_in"
  827 = "White and other race, n.e.c."
  830 = "Black and AIAN"
  831 = "Black and Asian"
  832 = "Black and Chinese"
  833 = "Black and Japanese"
  834 = "Black and Filipino"
  835 = "Black and Asian Indian"
  836 = "Black and Korean"
  837 = "Black and Asian write_in"
  838 = "Black and other Asian race(s)"
  840 = "Black and PI"
  841 = "Black and PI write_in"
  842 = "Black and other PI race(s)"
  845 = "Black and other race write_in"
  850 = "AIAN and Asian"
  851 = "AIAN and Filipino (2000 1%)"
  852 = "AIAN and Asian Indian"
  853 = "AIAN and Asian write_in (2000 1%)"
  854 = "AIAN and other Asian race(s)"
  855 = "AIAN and PI"
  856 = "AIAN and other race write_in"
  860 = "Asian and PI"
  861 = "Chinese and Hawaiian"
  862 = "Chinese, Filipino, Hawaiian (2000 1%)"
  863 = "Japanese and Hawaiian (2000 1%)"
  864 = "Filipino and Hawaiian"
  865 = "Filipino and PI write_in"
  866 = "Asian Indian and PI write_in (2000 1%)"
  867 = "Asian write_in and PI write_in"
  868 = "Other Asian race(s) and PI race(s)"
  869 = "Japanese and Korean (ACS)"
  880 = "Asian and other race write_in"
  881 = "Chinese and other race write_in"
  882 = "Japanese and other race write_in"
  883 = "Filipino and other race write_in"
  884 = "Asian Indian and other race write_in"
  885 = "Asian write_in and other race write_in"
  886 = "Other Asian race(s) and other race write_in"
  887 = "Chinese and Korean"
  890 = "PI and other race write_in:"
  891 = "PI write_in and other race write_in"
  892 = "Other PI race(s) and other race write_in"
  893 = "Native Hawaiian or PI other race(s)"
  899 = "API and other race write_in"
  901 = "White, Black, AIAN"
  902 = "White, Black, Asian"
  903 = "White, Black, PI"
  904 = "White, Black, other race write_in"
  905 = "White, AIAN, Asian"
  906 = "White, AIAN, PI"
  907 = "White, AIAN, other race write_in"
  910 = "White, Asian, PI"
  911 = "White, Chinese, Hawaiian"
  912 = "White, Chinese, Filipino, Hawaiian (2000 1%)"
  913 = "White, Japanese, Hawaiian (2000 1%)"
  914 = "White, Filipino, Hawaiian"
  915 = "Other White, Asian race(s), PI race(s)"
  916 = "White, AIAN and Filipino"
  917 = "White, Black, and Filipino"
  920 = "White, Asian, other race write_in"
  921 = "White, Filipino, other race write_in (2000 1%)"
  922 = "White, Asian write_in, other race write_in (2000 1%)"
  923 = "Other White, Asian race(s), other race write_in (2000 1%)"
  925 = "White, PI, other race write_in"
  930 = "Black, AIAN, Asian"
  931 = "Black, AIAN, PI"
  932 = "Black, AIAN, other race write_in"
  933 = "Black, Asian, PI"
  934 = "Black, Asian, other race write_in"
  935 = "Black, PI, other race write_in"
  940 = "AIAN, Asian, PI"
  941 = "AIAN, Asian, other race write_in"
  942 = "AIAN, PI, other race write_in"
  943 = "Asian, PI, other race write_in"
  944 = "Asian (Chinese, Japanese, Korean, Vietnamese); and Native Hawaiian or PI; and Other"
  949 = "2 or 3 races (CPS)"
  950 = "White, Black, AIAN, Asian"
  951 = "White, Black, AIAN, PI"
  952 = "White, Black, AIAN, other race write_in"
  953 = "White, Black, Asian, PI"
  954 = "White, Black, Asian, other race write_in"
  955 = "White, Black, PI, other race write_in"
  960 = "White, AIAN, Asian, PI"
  961 = "White, AIAN, Asian, other race write_in"
  962 = "White, AIAN, PI, other race write_in"
  963 = "White, Asian, PI, other race write_in"
  964 = "White, Chinese, Japanese, Native Hawaiian"
  970 = "Black, AIAN, Asian, PI"
  971 = "Black, AIAN, Asian, other race write_in"
  972 = "Black, AIAN, PI, other race write_in"
  973 = "Black, Asian, PI, other race write_in"
  974 = "AIAN, Asian, PI, other race write_in"
  975 = "AIAN, Asian, PI, Hawaiian other race write_in"
  976 = "Two specified Asian  (Chinese and other Asian, Chinese and Japanese, Japanese and other Asian, Korea"
        "n and other Asian); Native Hawaiian/PI; and Other Race"
  980 = "White, Black, AIAN, Asian, PI"
  981 = "White, Black, AIAN, Asian, other race write_in"
  982 = "White, Black, AIAN, PI, other race write_in"
  983 = "White, Black, Asian, PI, other race write_in"
  984 = "White, AIAN, Asian, PI, other race write_in"
  985 = "Black, AIAN, Asian, PI, other race write_in"
  986 = "Black, AIAN, Asian, PI, Hawaiian, other race write_in"
  989 = "4 or 5 races (CPS)"
  990 = "White, Black, AIAN, Asian, PI, other race write_in"
  991 = "White race; Some other race; Black or African American race and/or American Indian and Alaska Native"
        " race and/or Asian groups and/or Native Hawaiian and Other Pacific Islander groups"
  996 = "2+ races, n.e.c. (CPS)"
;

value HISPAN_f
  0 = "Not Hispanic"
  1 = "Mexican"
  2 = "Puerto Rican"
  3 = "Cuban"
  4 = "Other"
  9 = "Not Reported"
;

value HISPAND_f
  000 = "Not Hispanic"
  100 = "Mexican"
  102 = "Mexican American"
  103 = "Mexicano/Mexicana"
  104 = "Chicano/Chicana"
  105 = "La Raza"
  106 = "Mexican American Indian"
  107 = "Mexico"
  200 = "Puerto Rican"
  300 = "Cuban"
  401 = "Central American Indian"
  402 = "Canal Zone"
  411 = "Costa Rican"
  412 = "Guatemalan"
  413 = "Honduran"
  414 = "Nicaraguan"
  415 = "Panamanian"
  416 = "Salvadoran"
  417 = "Central American, n.e.c."
  420 = "Argentinean"
  421 = "Bolivian"
  422 = "Chilean"
  423 = "Colombian"
  424 = "Ecuadorian"
  425 = "Paraguayan"
  426 = "Peruvian"
  427 = "Uruguayan"
  428 = "Venezuelan"
  429 = "South American Indian"
  430 = "Criollo"
  431 = "South American, n.e.c."
  450 = "Spaniard"
  451 = "Andalusian"
  452 = "Asturian"
  453 = "Castillian"
  454 = "Catalonian"
  455 = "Balearic Islander"
  456 = "Gallego"
  457 = "Valencian"
  458 = "Canarian"
  459 = "Spanish Basque"
  460 = "Dominican"
  465 = "Latin American"
  470 = "Hispanic"
  480 = "Spanish"
  490 = "Californio"
  491 = "Tejano"
  492 = "Nuevo Mexicano"
  493 = "Spanish American"
  494 = "Spanish American Indian"
  495 = "Meso American Indian"
  496 = "Mestizo"
  498 = "Other, n.s."
  499 = "Other, n.e.c."
  900 = "Not Reported"
;

value EMPSTAT_f
  0 = "N/A"
  1 = "Employed"
  2 = "Unemployed"
  3 = "Not in labor force"
;

value EMPSTATD_f
  00 = "N/A"
  10 = "At work"
  11 = "At work, public emerg"
  12 = "Has job, not working"
  13 = "Armed forces"
  14 = "Armed forces--at work"
  15 = "Armed forces--not at work but with job"
  20 = "Unemployed"
  21 = "Unemp, exper worker"
  22 = "Unemp, new worker"
  30 = "Not in Labor Force"
  31 = "NILF, housework"
  32 = "NILF, unable to work"
  33 = "NILF, school"
  34 = "NILF, other"
;

value LABFORCE_f
  0 = "N/A"
  1 = "No, not in the labor force"
  2 = "Yes, in the labor force"
;

run;

data IPUMS.usa_00002;
infile ASCIIDAT pad missover lrecl=148;

input
  YEAR       1-4
  SAMPLE     5-10
  SERIAL     11-18
  CBSERIAL   19-31
  HHWT       32-41 .2
  CLUSTER    42-54
  STATEICP   55-56
  STRATA     57-68
  GQ         69-69
  PERNUM     70-73
  PERWT      74-83 .2
  RACE       84-84
  RACED      85-87
  HISPAN     88-88
  HISPAND    89-91
  EMPSTAT    92-92
  EMPSTATD   93-94
  LABFORCE   95-95
  INCTOT     96-102
  FTOTINC    103-109
  INCWAGE    110-115
  INCSS      116-120
  INCWELFR   121-125
  INCINVST   126-131
  INCRETIR   132-137
  TRANTIME   138-140
  DEPARTS    141-144
  ARRIVES    145-148
;

label
  YEAR     = "Census year"
  SAMPLE   = "IPUMS sample identifier"
  SERIAL   = "Household serial number"
  CBSERIAL = "Original Census Bureau household serial number"
  HHWT     = "Household weight"
  CLUSTER  = "Household cluster for variance estimation"
  STATEICP = "State (ICPSR code)"
  STRATA   = "Household strata for variance estimation"
  GQ       = "Group quarters status"
  PERNUM   = "Person number in sample unit"
  PERWT    = "Person weight"
  RACE     = "Race [general version]"
  RACED    = "Race [detailed version]"
  HISPAN   = "Hispanic origin [general version]"
  HISPAND  = "Hispanic origin [detailed version]"
  EMPSTAT  = "Employment status [general version]"
  EMPSTATD = "Employment status [detailed version]"
  LABFORCE = "Labor force status"
  INCTOT   = "Total personal income"
  FTOTINC  = "Total family income"
  INCWAGE  = "Wage and salary income"
  INCSS    = "Social Security income"
  INCWELFR = "Welfare (public assistance) income"
  INCINVST = "Interest, dividend, and rental income"
  INCRETIR = "Retirement income"
  TRANTIME = "Travel time to work"
  DEPARTS  = "Time of departure for work"
  ARRIVES  = "Time of arrival at work"
;

format
  YEAR      YEAR_f.
  SAMPLE    SAMPLE_f.
  STATEICP  STATEICP_f.
  GQ        GQ_f.
  RACE      RACE_f.
  RACED     RACED_f.
  HISPAN    HISPAN_f.
  HISPAND   HISPAND_f.
  EMPSTAT   EMPSTAT_f.
  EMPSTATD  EMPSTATD_f.
  LABFORCE  LABFORCE_f.
;

format
  CBSERIAL  13.
  HHWT      11.2
  CLUSTER   13.
  STRATA    12.
  PERWT     11.2
;

run;

 

 As you can see, at the very top it asks for the libname statement to be modified, and when I follow the instructions supplied on their website 

 

And08863_0-1606780012023.png

 

the modified code looks like this: 

 

libname ipumsdat 'C:\IPUMS\';
filename ASCIIDAT "usa_00002.dat"; 

 

and I get several different error messages:

 

 
1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         
 73         libname ipumsdat 'C:\IPUMS\';
 NOTE: Library IPUMSDAT does not exist.
 74         filename ASCIIDAT "usa_00002.dat";
 75         
 76         proc format cntlout = IPUMS.usa_00002_f;
 77         
 78         value YEAR_f
 79           1850 = "1850"
 80           1860 = "1860"
 81           1870 = "1870"
 82           1880 = "1880"
 83           1900 = "1900"
 84           1910 = "1910"
 85           1920 = "1920"
 86           1930 = "1930"
 87           1940 = "1940"
 88           1950 = "1950"
 89           1960 = "1960"
 90           1970 = "1970"
 91           1980 = "1980"
 92           1990 = "1990"
 93           2000 = "2000"
 94           2001 = "2001"
 95           2002 = "2002"
 96           2003 = "2003"
 97           2004 = "2004"
 98           2005 = "2005"
 99           2006 = "2006"
 100          2007 = "2007"
 101          2008 = "2008"
 102          2009 = "2009"
 103          2010 = "2010"
 104          2011 = "2011"
 105          2012 = "2012"
 106          2013 = "2013"
 107          2014 = "2014"
 108          2015 = "2015"
 109          2016 = "2016"
 110          2017 = "2017"
 111          2018 = "2018"
 112          2019 = "2019"
 113        ;
 NOTE: Format YEAR_F is already on the library WORK.FORMATS.
 NOTE: Format YEAR_F has been output.
 114        
 115        value SAMPLE_f
 116          201902 = "2019 PRCS"
 117          201901 = "2019 ACS"
 118          201804 = "2014-2018, PRCS 5-year"
 119          201803 = "2014-2018, ACS 5-year"
 120          201802 = "2018 PRCS"
 121          201801 = "2018 ACS"
 122          201704 = "2013-2017, PRCS 5-year"
 123          201703 = "2013-2017, ACS 5-year"
 124          201702 = "2017 PRCS"
 125          201701 = "2017 ACS"
 126          201604 = "2012-2016, PRCS 5-year"
 127          201603 = "2012-2016, ACS 5-year"
 128          201602 = "2016 PRCS"
 129          201601 = "2016 ACS"
 130          201504 = "2011-2015, PRCS 5-year"
 131          201503 = "2011-2015, ACS 5-year"
 132          201502 = "2015 PRCS"
 133          201501 = "2015 ACS"
 134          201404 = "2010-2014, PRCS 5-year"
 135          201403 = "2010-2014, ACS 5-year"
 136          201402 = "2014 PRCS"
 137          201401 = "2014 ACS"
 138          201306 = "2009-2013, PRCS 5-year"
 139          201305 = "2009-2013, ACS 5-year"
 140          201304 = "2011-2013, PRCS 3-year"
 141          201303 = "2011-2013, ACS 3-year"
 142          201302 = "2013 PRCS"
 143          201301 = "2013 ACS"
 144          201206 = "2008-2012, PRCS 5-year"
 145          201205 = "2008-2012, ACS 5-year"
 146          201204 = "2010-2012, PRCS 3-year"
 147          201203 = "2010-2012, ACS 3-year"
 148          201202 = "2012 PRCS"
 149          201201 = "2012 ACS"
 150          201106 = "2007-2011, PRCS 5-year"
 151          201105 = "2007-2011, ACS 5-year"
 152          201104 = "2009-2011, PRCS 3-year"
 153          201103 = "2009-2011, ACS 3-year"
 154          201102 = "2011 PRCS"
 155          201101 = "2011 ACS"
 156          201008 = "2010 Puerto Rico 10%"
 157          201007 = "2010 10%"
 158          201006 = "2006-2010, PRCS 5-year"
 159          201005 = "2006-2010, ACS 5-year"
 160          201004 = "2008-2010, PRCS 3-year"
 161          201003 = "2008-2010, ACS 3-year"
 162          201002 = "2010 PRCS"
 163          201001 = "2010 ACS"
 164          200906 = "2005-2009, PRCS 5-year"
 165          200905 = "2005-2009, ACS 5-year"
 166          200904 = "2007-2009, PRCS 3-year"
 167          200903 = "2007-2009, ACS 3-year"
 168          200902 = "2009 PRCS"
 169          200901 = "2009 ACS"
 170          200804 = "2006-2008, PRCS 3-year"
 171          200803 = "2006-2008, ACS 3-year"
 172          200802 = "2008 PRCS"
 173          200801 = "2008 ACS"
 174          200704 = "2005-2007, PRCS 3-year"
 175          200703 = "2005-2007, ACS 3-year"
 176          200702 = "2007 PRCS"
 177          200701 = "2007 ACS"
 178          200602 = "2006 PRCS"
 179          200601 = "2006 ACS"
 180          200502 = "2005 PRCS"
 181          200501 = "2005 ACS"
 182          200401 = "2004 ACS"
 183          200301 = "2003 ACS"
 184          200201 = "2002 ACS"
 185          200101 = "2001 ACS"
 186          200008 = "2000 Puerto Rico 1%"
 187          200007 = "2000 1%"
 188          200006 = "2000 Puerto Rico 1% sample (old version)"
 189          200005 = "2000 Puerto Rico 5%"
 190          200004 = "2000 ACS"
 191          200003 = "2000 Unweighted 1%"
 192          200002 = "2000 1% sample (old version)"
 193          200001 = "2000 5%"
 194          199007 = "1990 Puerto Rico 1%"
 195          199006 = "1990 Puerto Rico 5%"
 196          199005 = "1990 Labor Market Area"
 197          199004 = "1990 Elderly"
 198          199003 = "1990 Unweighted 1%"
 199          199002 = "1990 1%"
 200          199001 = "1990 5%"
 201          198007 = "1980 Puerto Rico 1%"
 202          198006 = "1980 Puerto Rico 5%"
 203          198005 = "1980 Detailed metro/non-metro"
 204          198004 = "1980 Labor Market Area"
 205          198003 = "1980 Urban/Rural"
 206          198002 = "1980 1%"
 207          198001 = "1980 5%"
 208          197009 = "1970 Puerto Rico Neighborhood"
 209          197008 = "1970 Puerto Rico Municipio"
 210          197007 = "1970 Puerto Rico State"
 211          197006 = "1970 Form 2 Neighborhood"
 212          197005 = "1970 Form 1 Neighborhood"
 213          197004 = "1970 Form 2 Metro"
 214          197003 = "1970 Form 1 Metro"
 215          197002 = "1970 Form 2 State"
 216          197001 = "1970 Form 1 State"
 217          196002 = "1960 5%"
 218          196001 = "1960 1%"
 219          195001 = "1950 1%"
 220          194002 = "1940 100% database"
 221          194001 = "1940 1%"
 222          193004 = "1930 100% database"
 223          193003 = "1930 Puerto Rico"
 224          193002 = "1930 5%"
 225          193001 = "1930 1%"
 226          192003 = "1920 100% database"
 227          192002 = "1920 Puerto Rico sample"
 228          192001 = "1920 1%"
 229          191004 = "1910 100% database"
 230          191003 = "1910 1.4% sample with oversamples"
 231          191002 = "1910 1%"
 232          191001 = "1910 Puerto Rico"
 233          190004 = "1900 100% database"
 234          190003 = "1900 1% sample with oversamples"
 235          190002 = "1900 1%"
 236          190001 = "1900 5%"
 237          188003 = "1880 100% database"
 238          188002 = "1880 10%"
 239          188001 = "1880 1%"
 240          187003 = "1870 100% database"
 241          187002 = "1870 1% sample with black oversample"
 242          187001 = "1870 1%"
 243          186003 = "1860 100% database"
 244          186002 = "1860 1% sample with black oversample"
 245          186001 = "1860 1%"
 246          185002 = "1850 100% database"
 247          185001 = "1850 1%"
 248        ;
 NOTE: Format SAMPLE_F is already on the library WORK.FORMATS.
 NOTE: Format SAMPLE_F has been output.
 249        
 250        value STATEICP_f
 251          01 = "Connecticut"
 252          02 = "Maine"
 253          03 = "Massachusetts"
 254          04 = "New Hampshire"
 255          05 = "Rhode Island"
 256          06 = "Vermont"
 257          11 = "Delaware"
 258          12 = "New Jersey"
 259          13 = "New York"
 260          14 = "Pennsylvania"
 261          21 = "Illinois"
 262          22 = "Indiana"
 263          23 = "Michigan"
 264          24 = "Ohio"
 265          25 = "Wisconsin"
 266          31 = "Iowa"
 267          32 = "Kansas"
 268          33 = "Minnesota"
 269          34 = "Missouri"
 270          35 = "Nebraska"
 271          36 = "North Dakota"
 272          37 = "South Dakota"
 273          40 = "Virginia"
 274          41 = "Alabama"
 275          42 = "Arkansas"
 276          43 = "Florida"
 277          44 = "Georgia"
 278          45 = "Louisiana"
 279          46 = "Mississippi"
 280          47 = "North Carolina"
 281          48 = "South Carolina"
 282          49 = "Texas"
 283          51 = "Kentucky"
 284          52 = "Maryland"
 285          53 = "Oklahoma"
 286          54 = "Tennessee"
 287          56 = "West Virginia"
 288          61 = "Arizona"
 289          62 = "Colorado"
 290          63 = "Idaho"
 291          64 = "Montana"
 292          65 = "Nevada"
 293          66 = "New Mexico"
 294          67 = "Utah"
 295          68 = "Wyoming"
 296          71 = "California"
 297          72 = "Oregon"
 298          73 = "Washington"
 299          81 = "Alaska"
 300          82 = "Hawaii"
 301          83 = "Puerto Rico"
 302          96 = "State groupings (1980 Urban/rural sample)"
 303          97 = "Military/Mil. Reservations"
 304          98 = "District of Columbia"
 305          99 = "State not identified"
 306        ;
 NOTE: Format STATEICP_F is already on the library WORK.FORMATS.
 NOTE: Format STATEICP_F has been output.
 307        
 308        value GQ_f
 309          0 = "Vacant unit"
 310          1 = "Households under 1970 definition"
 311          2 = "Additional households under 1990 definition"
 312          3 = "Group quarters--Institutions"
 313          4 = "Other group quarters"
 314          5 = "Additional households under 2000 definition"
 315          6 = "Fragment"
 316        ;
 NOTE: Format GQ_F is already on the library WORK.FORMATS.
 NOTE: Format GQ_F has been output.
 317        
 318        value RACE_f
 319          1 = "White"
 320          2 = "Black/African American/Negro"
 321          3 = "American Indian or Alaska Native"
 322          4 = "Chinese"
 323          5 = "Japanese"
 324          6 = "Other Asian or Pacific Islander"
 325          7 = "Other race, nec"
 326          8 = "Two major races"
 327          9 = "Three or more major races"
 328        ;
 NOTE: Format RACE_F is already on the library WORK.FORMATS.
 NOTE: Format RACE_F has been output.
 329        
 330        value RACED_f
 331          100 = "White"
 332          110 = "Spanish write_in"
 333          120 = "Blank (white) (1850)"
 334          130 = "Portuguese"
 335          140 = "Mexican (1930)"
 336          150 = "Puerto Rican (1910 Hawaii)"
 337          200 = "Black/African American/Negro"
 338          210 = "Mulatto"
 339          300 = "American Indian/Alaska Native"
 340          302 = "Apache"
 341          303 = "Blackfoot"
 342          304 = "Cherokee"
 343          305 = "Cheyenne"
 344          306 = "Chickasaw"
 345          307 = "Chippewa"
 346          308 = "Choctaw"
 347          309 = "Comanche"
 348          310 = "Creek"
 349          311 = "Crow"
 350          312 = "Iroquois"
 351          313 = "Kiowa"
 352          314 = "Lumbee"
 353          315 = "Navajo"
 354          316 = "Osage"
 355          317 = "Paiute"
 356          318 = "Pima"
 357          319 = "Potawatomi"
 358          320 = "Pueblo"
 359          321 = "Seminole"
 360          322 = "Shoshone"
 361          323 = "Sioux"
 362          324 = "Tlingit (Tlingit_Haida, 2000/ACS)"
 363          325 = "Tohono O Odham"
 364          326 = "All other tribes (1990)"
 365          328 = "Hopi"
 366          329 = "Central American Indian"
 367          330 = "Spanish American Indian"
 368          350 = "Delaware"
 369          351 = "Latin American Indian"
 370          352 = "Puget Sound Salish"
 371          353 = "Yakama"
 372          354 = "Yaqui"
 373          355 = "Colville"
 374          356 = "Houma"
 375          357 = "Menominee"
 376          358 = "Yuman"
 377          359 = "South American Indian"
 378          360 = "Mexican American Indian"
 379          361 = "Other Amer. Indian tribe (2000,ACS)"
 380          362 = "2+ Amer. Indian tribes (2000,ACS)"
 381          370 = "Alaskan Athabaskan"
 382          371 = "Aleut"
 383          372 = "Eskimo"
 384          373 = "Alaskan mixed"
 385          374 = "Inupiat"
 386          375 = "Yup'ik"
 387          379 = "Other Alaska Native tribe(s) (2000,ACS)"
 388          398 = "Both Am. Ind. and Alaska Native (2000,ACS)"
 389          399 = "Tribe not specified"
 390          400 = "Chinese"
 391          410 = "Taiwanese"
 392          420 = "Chinese and Taiwanese"
 393          500 = "Japanese"
 394          600 = "Filipino"
 395          610 = "Asian Indian (Hindu 1920_1940)"
 396          620 = "Korean"
 397          630 = "Hawaiian"
 398          631 = "Hawaiian and Asian (1900,1920)"
 399          632 = "Hawaiian and European (1900,1920)"
 400          634 = "Hawaiian mixed"
 401          640 = "Vietnamese"
 402          641 = "Bhutanese"
 403          642 = "Mongolian"
 404          643 = "Nepalese"
 405          650 = "Other Asian or Pacific Islander (1920,1980)"
 406          651 = "Asian only (CPS)"
 407          652 = "Pacific Islander only (CPS)"
 408          653 = "Asian or Pacific Islander, n.s. (1990 Internal Census files)"
 409          660 = "Cambodian"
 410          661 = "Hmong"
 411          662 = "Laotian"
 412          663 = "Thai"
 413          664 = "Bangladeshi"
 414          665 = "Burmese"
 415          666 = "Indonesian"
 416          667 = "Malaysian"
 417          668 = "Okinawan"
 418          669 = "Pakistani"
 419          670 = "Sri Lankan"
 420          671 = "Other Asian, n.e.c."
 421          672 = "Asian, not specified"
 422          673 = "Chinese and Japanese"
 423          674 = "Chinese and Filipino"
 424          675 = "Chinese and Vietnamese"
 425          676 = "Chinese and Asian write_in"
 426          677 = "Japanese and Filipino"
 427          678 = "Asian Indian and Asian write_in"
 428          679 = "Other Asian race combinations"
 429          680 = "Samoan"
 430          681 = "Tahitian"
 431          682 = "Tongan"
 432          683 = "Other Polynesian (1990)"
 433          684 = "1+ other Polynesian races (2000,ACS)"
 434          685 = "Guamanian/Chamorro"
 435          686 = "Northern Mariana Islander"
 436          687 = "Palauan"
 437          688 = "Other Micronesian (1990)"
 438          689 = "1+ other Micronesian races (2000,ACS)"
 439          690 = "Fijian"
 440          691 = "Other Melanesian (1990)"
 441          692 = "1+ other Melanesian races (2000,ACS)"
 442          698 = "2+ PI races from 2+ PI regions"
 443          699 = "Pacific Islander, n.s."
 444          700 = "Other race, n.e.c."
 445          801 = "White and Black"
 446          802 = "White and AIAN"
 447          810 = "White and Asian"
 448          811 = "White and Chinese"
 449          812 = "White and Japanese"
 450          813 = "White and Filipino"
 451          814 = "White and Asian Indian"
 452          815 = "White and Korean"
 453          816 = "White and Vietnamese"
 454          817 = "White and Asian write_in"
 455          818 = "White and other Asian race(s)"
 456          819 = "White and two or more Asian groups"
 457          820 = "White and PI"
 458          821 = "White and Native Hawaiian"
 459          822 = "White and Samoan"
 460          823 = "White and Guamanian"
 461          824 = "White and PI write_in"
 462          825 = "White and other PI race(s)"
 463          826 = "White and other race write_in"
 464          827 = "White and other race, n.e.c."
 465          830 = "Black and AIAN"
 466          831 = "Black and Asian"
 467          832 = "Black and Chinese"
 468          833 = "Black and Japanese"
 469          834 = "Black and Filipino"
 470          835 = "Black and Asian Indian"
 471          836 = "Black and Korean"
 472          837 = "Black and Asian write_in"
 473          838 = "Black and other Asian race(s)"
 474          840 = "Black and PI"
 475          841 = "Black and PI write_in"
 476          842 = "Black and other PI race(s)"
 477          845 = "Black and other race write_in"
 478          850 = "AIAN and Asian"
 479          851 = "AIAN and Filipino (2000 1%)"
 480          852 = "AIAN and Asian Indian"
 481          853 = "AIAN and Asian write_in (2000 1%)"
 482          854 = "AIAN and other Asian race(s)"
 483          855 = "AIAN and PI"
 484          856 = "AIAN and other race write_in"
 485          860 = "Asian and PI"
 486          861 = "Chinese and Hawaiian"
 487          862 = "Chinese, Filipino, Hawaiian (2000 1%)"
 488          863 = "Japanese and Hawaiian (2000 1%)"
 489          864 = "Filipino and Hawaiian"
 490          865 = "Filipino and PI write_in"
 491          866 = "Asian Indian and PI write_in (2000 1%)"
 492          867 = "Asian write_in and PI write_in"
 493          868 = "Other Asian race(s) and PI race(s)"
 494          869 = "Japanese and Korean (ACS)"
 495          880 = "Asian and other race write_in"
 496          881 = "Chinese and other race write_in"
 497          882 = "Japanese and other race write_in"
 498          883 = "Filipino and other race write_in"
 499          884 = "Asian Indian and other race write_in"
 500          885 = "Asian write_in and other race write_in"
 501          886 = "Other Asian race(s) and other race write_in"
 502          887 = "Chinese and Korean"
 503          890 = "PI and other race write_in:"
 504          891 = "PI write_in and other race write_in"
 505          892 = "Other PI race(s) and other race write_in"
 506          893 = "Native Hawaiian or PI other race(s)"
 507          899 = "API and other race write_in"
 508          901 = "White, Black, AIAN"
 509          902 = "White, Black, Asian"
 510          903 = "White, Black, PI"
 511          904 = "White, Black, other race write_in"
 512          905 = "White, AIAN, Asian"
 513          906 = "White, AIAN, PI"
 514          907 = "White, AIAN, other race write_in"
 515          910 = "White, Asian, PI"
 516          911 = "White, Chinese, Hawaiian"
 517          912 = "White, Chinese, Filipino, Hawaiian (2000 1%)"
 518          913 = "White, Japanese, Hawaiian (2000 1%)"
 519          914 = "White, Filipino, Hawaiian"
 520          915 = "Other White, Asian race(s), PI race(s)"
 521          916 = "White, AIAN and Filipino"
 522          917 = "White, Black, and Filipino"
 523          920 = "White, Asian, other race write_in"
 524          921 = "White, Filipino, other race write_in (2000 1%)"
 525          922 = "White, Asian write_in, other race write_in (2000 1%)"
 526          923 = "Other White, Asian race(s), other race write_in (2000 1%)"
 527          925 = "White, PI, other race write_in"
 528          930 = "Black, AIAN, Asian"
 529          931 = "Black, AIAN, PI"
 530          932 = "Black, AIAN, other race write_in"
 531          933 = "Black, Asian, PI"
 532          934 = "Black, Asian, other race write_in"
 533          935 = "Black, PI, other race write_in"
 534          940 = "AIAN, Asian, PI"
 535          941 = "AIAN, Asian, other race write_in"
 536          942 = "AIAN, PI, other race write_in"
 537          943 = "Asian, PI, other race write_in"
 538          944 = "Asian (Chinese, Japanese, Korean, Vietnamese); and Native Hawaiian or PI; and Other"
 539          949 = "2 or 3 races (CPS)"
 540          950 = "White, Black, AIAN, Asian"
 541          951 = "White, Black, AIAN, PI"
 542          952 = "White, Black, AIAN, other race write_in"
 543          953 = "White, Black, Asian, PI"
 544          954 = "White, Black, Asian, other race write_in"
 545          955 = "White, Black, PI, other race write_in"
 546          960 = "White, AIAN, Asian, PI"
 547          961 = "White, AIAN, Asian, other race write_in"
 548          962 = "White, AIAN, PI, other race write_in"
 549          963 = "White, Asian, PI, other race write_in"
 550          964 = "White, Chinese, Japanese, Native Hawaiian"
 551          970 = "Black, AIAN, Asian, PI"
 552          971 = "Black, AIAN, Asian, other race write_in"
 553          972 = "Black, AIAN, PI, other race write_in"
 554          973 = "Black, Asian, PI, other race write_in"
 555          974 = "AIAN, Asian, PI, other race write_in"
 556          975 = "AIAN, Asian, PI, Hawaiian other race write_in"
 557          976 = "Two specified Asian  (Chinese and other Asian, Chinese and Japanese, Japanese and other Asian, Korea"
 558                "n and other Asian); Native Hawaiian/PI; and Other Race"
 559          980 = "White, Black, AIAN, Asian, PI"
 560          981 = "White, Black, AIAN, Asian, other race write_in"
 561          982 = "White, Black, AIAN, PI, other race write_in"
 562          983 = "White, Black, Asian, PI, other race write_in"
 563          984 = "White, AIAN, Asian, PI, other race write_in"
 564          985 = "Black, AIAN, Asian, PI, other race write_in"
 565          986 = "Black, AIAN, Asian, PI, Hawaiian, other race write_in"
 566          989 = "4 or 5 races (CPS)"
 567          990 = "White, Black, AIAN, Asian, PI, other race write_in"
 568          991 = "White race; Some other race; Black or African American race and/or American Indian and Alaska Native"
 569                " race and/or Asian groups and/or Native Hawaiian and Other Pacific Islander groups"
 570          996 = "2+ races, n.e.c. (CPS)"
 571        ;
 NOTE: Format RACED_F is already on the library WORK.FORMATS.
 NOTE: Format RACED_F has been output.
 572        
 573        value HISPAN_f
 574          0 = "Not Hispanic"
 575          1 = "Mexican"
 576          2 = "Puerto Rican"
 577          3 = "Cuban"
 578          4 = "Other"
 579          9 = "Not Reported"
 580        ;
 NOTE: Format HISPAN_F is already on the library WORK.FORMATS.
 NOTE: Format HISPAN_F has been output.
 581        
 582        value HISPAND_f
 583          000 = "Not Hispanic"
 584          100 = "Mexican"
 585          102 = "Mexican American"
 586          103 = "Mexicano/Mexicana"
 587          104 = "Chicano/Chicana"
 588          105 = "La Raza"
 589          106 = "Mexican American Indian"
 590          107 = "Mexico"
 591          200 = "Puerto Rican"
 592          300 = "Cuban"
 593          401 = "Central American Indian"
 594          402 = "Canal Zone"
 595          411 = "Costa Rican"
 596          412 = "Guatemalan"
 597          413 = "Honduran"
 598          414 = "Nicaraguan"
 599          415 = "Panamanian"
 600          416 = "Salvadoran"
 601          417 = "Central American, n.e.c."
 602          420 = "Argentinean"
 603          421 = "Bolivian"
 604          422 = "Chilean"
 605          423 = "Colombian"
 606          424 = "Ecuadorian"
 607          425 = "Paraguayan"
 608          426 = "Peruvian"
 609          427 = "Uruguayan"
 610          428 = "Venezuelan"
 611          429 = "South American Indian"
 612          430 = "Criollo"
 613          431 = "South American, n.e.c."
 614          450 = "Spaniard"
 615          451 = "Andalusian"
 616          452 = "Asturian"
 617          453 = "Castillian"
 618          454 = "Catalonian"
 619          455 = "Balearic Islander"
 620          456 = "Gallego"
 621          457 = "Valencian"
 622          458 = "Canarian"
 623          459 = "Spanish Basque"
 624          460 = "Dominican"
 625          465 = "Latin American"
 626          470 = "Hispanic"
 627          480 = "Spanish"
 628          490 = "Californio"
 629          491 = "Tejano"
 630          492 = "Nuevo Mexicano"
 631          493 = "Spanish American"
 632          494 = "Spanish American Indian"
 633          495 = "Meso American Indian"
 634          496 = "Mestizo"
 635          498 = "Other, n.s."
 636          499 = "Other, n.e.c."
 637          900 = "Not Reported"
 638        ;
 NOTE: Format HISPAND_F is already on the library WORK.FORMATS.
 NOTE: Format HISPAND_F has been output.
 639        
 640        value EMPSTAT_f
 641          0 = "N/A"
 642          1 = "Employed"
 643          2 = "Unemployed"
 644          3 = "Not in labor force"
 645        ;
 NOTE: Format EMPSTAT_F is already on the library WORK.FORMATS.
 NOTE: Format EMPSTAT_F has been output.
 646        
 647        value EMPSTATD_f
 648          00 = "N/A"
 649          10 = "At work"
 650          11 = "At work, public emerg"
 651          12 = "Has job, not working"
 652          13 = "Armed forces"
 653          14 = "Armed forces--at work"
 654          15 = "Armed forces--not at work but with job"
 655          20 = "Unemployed"
 656          21 = "Unemp, exper worker"
 657          22 = "Unemp, new worker"
 658          30 = "Not in Labor Force"
 659          31 = "NILF, housework"
 660          32 = "NILF, unable to work"
 661          33 = "NILF, school"
 662          34 = "NILF, other"
 663        ;
 NOTE: Format EMPSTATD_F is already on the library WORK.FORMATS.
 NOTE: Format EMPSTATD_F has been output.
 664        
 665        value LABFORCE_f
 666          0 = "N/A"
 667          1 = "No, not in the labor force"
 668          2 = "Yes, in the labor force"
 669        ;
 NOTE: Format LABFORCE_F is already on the library WORK.FORMATS.
 NOTE: Format LABFORCE_F has been output.
 670        
 671        run;
 
 NOTE: PROCEDURE FORMAT used (Total process time):
       real time           0.08 seconds
       cpu time            0.07 seconds
       
 NOTE: The data set IPUMS.USA_00002_F has 558 observations and 21 variables.
 
 672        
 673        data IPUMS.usa_00002;
 674        infile ASCIIDAT pad missover lrecl=148;
 675        
 676        input
 677          YEAR       1-4
 678          SAMPLE     5-10
 679          SERIAL     11-18
 680          CBSERIAL   19-31
 681          HHWT       32-41 .2
 682          CLUSTER    42-54
 683          STATEICP   55-56
 684          STRATA     57-68
 685          GQ         69-69
 686          PERNUM     70-73
 687          PERWT      74-83 .2
 688          RACE       84-84
 689          RACED      85-87
 690          HISPAN     88-88
 691          HISPAND    89-91
 692          EMPSTAT    92-92
 693          EMPSTATD   93-94
 694          LABFORCE   95-95
 695          INCTOT     96-102
 696          FTOTINC    103-109
 697          INCWAGE    110-115
 698          INCSS      116-120
 699          INCWELFR   121-125
 700          INCINVST   126-131
 701          INCRETIR   132-137
 702          TRANTIME   138-140
 703          DEPARTS    141-144
 704          ARRIVES    145-148
 705        ;
 706        
 707        label
 708          YEAR     = "Census year"
 709          SAMPLE   = "IPUMS sample identifier"
 710          SERIAL   = "Household serial number"
 711          CBSERIAL = "Original Census Bureau household serial number"
 712          HHWT     = "Household weight"
 713          CLUSTER  = "Household cluster for variance estimation"
 714          STATEICP = "State (ICPSR code)"
 715          STRATA   = "Household strata for variance estimation"
 716          GQ       = "Group quarters status"
 717          PERNUM   = "Person number in sample unit"
 718          PERWT    = "Person weight"
 719          RACE     = "Race [general version]"
 720          RACED    = "Race [detailed version]"
 721          HISPAN   = "Hispanic origin [general version]"
 722          HISPAND  = "Hispanic origin [detailed version]"
 723          EMPSTAT  = "Employment status [general version]"
 724          EMPSTATD = "Employment status [detailed version]"
 725          LABFORCE = "Labor force status"
 726          INCTOT   = "Total personal income"
 727          FTOTINC  = "Total family income"
 728          INCWAGE  = "Wage and salary income"
 729          INCSS    = "Social Security income"
 730          INCWELFR = "Welfare (public assistance) income"
 731          INCINVST = "Interest, dividend, and rental income"
 732          INCRETIR = "Retirement income"
 733          TRANTIME = "Travel time to work"
 734          DEPARTS  = "Time of departure for work"
 735          ARRIVES  = "Time of arrival at work"
 736        ;
 737        
 738        format
 739          YEAR      YEAR_f.
 740          SAMPLE    SAMPLE_f.
 741          STATEICP  STATEICP_f.
 742          GQ        GQ_f.
 743          RACE      RACE_f.
 744          RACED     RACED_f.
 745          HISPAN    HISPAN_f.
 746          HISPAND   HISPAND_f.
 747          EMPSTAT   EMPSTAT_f.
 748          EMPSTATD  EMPSTATD_f.
 749          LABFORCE  LABFORCE_f.
 750        ;
 751        
 752        format
 753          CBSERIAL  13.
 754          HHWT      11.2
 755          CLUSTER   13.
 756          STRATA    12.
 757          PERWT     11.2
 758        ;
 759        
 760        run;
 
 ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/usa_00002.dat.
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set IPUMS.USA_00002 may be incomplete.  When this step was stopped there were 0 observations and 28 variables.
 WARNING: Data set IPUMS.USA_00002 was not replaced because this step was stopped.
 NOTE: DATA statement used (Total process time):
       real time           0.04 seconds
       cpu time            0.03 seconds
       
 
 761        
 762        
 763        OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 775        
The output looks like this:
Screenshot 2020-11-30 174047.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I am a first semester Biostats student and would really appreciate the help!  

1 ACCEPTED SOLUTION

Accepted Solutions
And08863
Fluorite | Level 6

Hello all, a friend of mine helped me figure it out. 

 

libname IPUMS "/folders/myfolders/datafile/usa_00002.dat/";
filename ASCIIDAT "/folders/myfolders/datafile/usa_00002.dat/usa_00002.dat";

So the only difference between the statements is that the libname includes the filepath up until the actual datafile name, while filename includes the filepath and the datafile name. I hope this helps out anyone else in the future! 

View solution in original post

3 REPLIES 3
ballardw
Super User

Your cause is this statement:

 filename ASCIIDAT "usa_00002.dat";

ASCIIDAT is a file reference used in the INFILE statement in the data step to read. However if you do not provide the full path to the file (drive and folders) then SAS assumes the file is in the current working folder which will usually be from SAS program folder.

 

However since you are using the SAS University edition the Path has to start at the mount point you set up your virtual machine which would start with /folders/myfolders/ if done correctly. Your data file and Library both would have to be found in relation to that from the SAS session, not your system path because the installation of the virtual machine it runs in "short cuts" the paths. If you don't see the text file in the SAS folder paths then you likely need to move it.

 

I'm not sure how well the University Edition plays with google drive.

 

For future questions start by showing us the actual LOG text of the FIRST step that throws an error. The Formats and such aren't likely to be the issue, so you cut through a bunch of stuff not needed for the question.

 

I suspect the instructions you received were for a traditional licensed stand-along SAS version.

 

BTW, the "no delimiter" file like this is referred to as "fixed column". The same variable always occupies the same columns in the file. That is what the numbers immediately following the variable name in the Input statement are. The occasional .2 is telling SAS to insert a decimal in values at a specific column.

And08863
Fluorite | Level 6

Thank you for explaining all the specific jargon, that's very helpful for explaining better in the future! I am unsure how to move forward as you suggest - the file is based in folders/myfolders/ as you can see here: 

And08863_0-1606791928671.png

 

And here is the properties pop-up:

 

And08863_1-1606791956358.png

 

So what should I be changing specifically in the code? 

And08863
Fluorite | Level 6

Hello all, a friend of mine helped me figure it out. 

 

libname IPUMS "/folders/myfolders/datafile/usa_00002.dat/";
filename ASCIIDAT "/folders/myfolders/datafile/usa_00002.dat/usa_00002.dat";

So the only difference between the statements is that the libname includes the filepath up until the actual datafile name, while filename includes the filepath and the datafile name. I hope this helps out anyone else in the future! 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1832 views
  • 1 like
  • 2 in conversation