<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Proc Import text file doesn't import all my data in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713238#M27131</link>
    <description>Why do you think records are missing?</description>
    <pubDate>Thu, 21 Jan 2021 22:20:12 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-01-21T22:20:12Z</dc:date>
    <item>
      <title>Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713233#M27129</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am importing 27 text files into a single files in SAS but some of my data are missing in the final file I created. I am not sure how to solve it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc import datafile='C:\Users\bmrg2\Box Sync\Mizzou 2019\Research\SAS Code\Blandine Data\RBI2020\ILLINOIS\IL_Added_inspection_year\*.txt'&lt;BR /&gt;dbms=dlm out=IL.IL_NBI_Data replace; &lt;BR /&gt;delimiter =","; &lt;BR /&gt;getnames=yes;&lt;BR /&gt;guessingrows=1750000;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data have 16 variables (columns) and at least 28000 observations(row). How can I fix that or how do I make sure all the data are all imported?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 21:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713233#M27129</guid>
      <dc:creator>Blandine</dc:creator>
      <dc:date>2021-01-21T21:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713235#M27130</link>
      <description>&lt;P&gt;You need to investigate each import file to identify which ones are problematic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Open each file in a text editor (not Excel) and verify the number of records. Read that file into SAS and verify you get the same number of data rows in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need to fine tune the SAS DATA step code that SAS generates with PROC IMPORT. You will see this in your SAS log. You just copy it back to your SAS editor and run it from there after making any required changes.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 22:10:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713235#M27130</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-01-21T22:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713238#M27131</link>
      <description>Why do you think records are missing?</description>
      <pubDate>Thu, 21 Jan 2021 22:20:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713238#M27131</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-21T22:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713248#M27132</link>
      <description>&lt;P&gt;I did some data processing afterwards and that how I found out something was wrong. After some investigations I found out the issue was with the proc import. Individual files are OK but when I imported them into a single file I have some rows missing&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 22:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713248#M27132</guid>
      <dc:creator>Blandine</dc:creator>
      <dc:date>2021-01-21T22:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713249#M27133</link>
      <description>&lt;P&gt;A couple of minor comments:&lt;/P&gt;
&lt;P&gt;If you attempt to read multiple files and each of the files has a header row, which seems likely from your use of "Getnames=Yes", then I suspect most if not all of your variables will be character due to encountering the header row of the second file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What does the LOG look like? Does it indicate 27 files were read? Any warnings?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Import will generate data step code that appears in the log to diagnose specific variable issues.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 22:48:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713249#M27133</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-21T22:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713250#M27134</link>
      <description>What do you mean you imported them into a single file? Did you write a manual data step that then re-processed all the files?&lt;BR /&gt;Did you combine the inputs from multiple iterations of PROC IMPORT?&lt;BR /&gt;&lt;BR /&gt;The code shown is not problematic, assuming your log is clean, so it's a logical issue most likely somewhere in your process. If your log isn't clean from the import then post that.&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jan 2021 23:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713250#M27134</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-21T23:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713257#M27135</link>
      <description>&lt;P&gt;The log file is clean, After investigating my each file (prior to merging them into a single file) I realized that in the first 3 files, one column variable (STRUCTURE_NUMBER_008) is num type and the rest (24&amp;nbsp; remaining files) are Char&amp;nbsp; type.&lt;/P&gt;
&lt;P&gt;In the single file previously created I only find the first 3 observation of my variable&amp;nbsp;STRUCTURE_NUMBER_008 which I assumed SAS only considered the num type.&lt;/P&gt;
&lt;P&gt;I tried to convert it in Char type but it changed the observation label. I want to keep the original label and format so it will match the remaining 24 files and I can do a quick check but I don't know how to do it.&lt;/P&gt;
&lt;P&gt;I must say that in each files the observation are repeated (I am working with bridge data for 27 years) and I have the same variable name.&lt;/P&gt;
&lt;P&gt;This is the original file with the variable that has issue (Sorry I can't upload screenshot it won't let me)&lt;/P&gt;
&lt;DIV id="tinyMceEditorBlandine_5" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;STRUCTURE_NUMBER_008&lt;/P&gt;
&lt;P&gt;1000200603&lt;/P&gt;
&lt;P&gt;1000300604&lt;/P&gt;
&lt;P&gt;1000400605&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;after transformation (from num to Char) I get this&lt;/P&gt;
&lt;DIV id="tinyMceEditorBlandine_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;STRUCTURE_NUMBER_008&lt;/P&gt;
&lt;DIV id="tinyMceEditorBlandine_4" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;1.0002E9&lt;/P&gt;
&lt;P&gt;1.0003E9&lt;/P&gt;
&lt;P&gt;1.0004E9&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;DIV id="tinyMceEditorBlandine_3" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditorBlandine_2" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorBlandine_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;the code I used to change from num typ to Char type is:&lt;/P&gt;
&lt;P&gt;proc sql noprint;&lt;BR /&gt;select name into :varlist separated by ' '&lt;BR /&gt;from sashelp.vcolumn&lt;BR /&gt;where upcase(libname) eq 'IL' and upcase(memname) eq 'IL1992';&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;/* modify variable type and length */&lt;BR /&gt;data IL.IL1992 (drop=v1);&lt;BR /&gt;retain &amp;amp;varlist; *&amp;lt;-- preserve variable order ;&lt;BR /&gt;length STRUCTURE_NUMBER_008 $15 ; *&amp;lt;-- define new types/lengths ;&lt;BR /&gt;set IL.IL1992 (rename=(STRUCTURE_NUMBER_008=v1));&lt;BR /&gt;STRUCTURE_NUMBER_008 = put(v1,15.); *&amp;lt;-- redefine STRUCTURE_NUMBER_008 variable ;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 00:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713257#M27135</guid>
      <dc:creator>Blandine</dc:creator>
      <dc:date>2021-01-22T00:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713259#M27136</link>
      <description>&lt;P&gt;You should use the DATA step code generated by PROC IMPORT to read in all your files. That way you can ensure all variables stay the same type when reading all your CSV files and avoid having to do type conversions at all.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 00:55:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713259#M27136</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-01-22T00:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713261#M27137</link>
      <description>&lt;P&gt;This is exactly why you should not use PROC IMPORT to read multiple files that should all have the same structure.&amp;nbsp; PROC IMPORT has to GUESS how to define the variables. By asking it to process each file independently it might make different decisions on different subsets of the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if those numbers are supposed to be identifiers then leave them as character strings.&amp;nbsp; There is limit to the number of digits you can store in a number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all of your CSV filenames follow a simple pattern you can even use a wildcard in the INFILE statement to read them all at once.&amp;nbsp; So if you just want to read the first three variables from the files then code like this will read all of the files.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
   length filen $256 ;
   infile '/my directory/*.csv' dsd truncover filename=filen;
   input @;
   if filen ne lag(filen) then input ;
   input var1 var2 STRUCTURE_NUMBER_008 :$20. ;
   filename=filen ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 01:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713261#M27137</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-22T01:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713262#M27138</link>
      <description>&lt;P&gt;Is this National Bridge Inventory data?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.fhwa.dot.gov/bridge/nbi.cfm" target="_blank"&gt;https://www.fhwa.dot.gov/bridge/nbi.cfm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 01:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713262#M27138</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-22T01:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713349#M27141</link>
      <description>&lt;P&gt;Yes it is&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 14:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713349#M27141</guid>
      <dc:creator>Blandine</dc:creator>
      <dc:date>2021-01-22T14:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713350#M27142</link>
      <description>&lt;P&gt;Can you please help me with the code then?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 14:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713350#M27142</guid>
      <dc:creator>Blandine</dc:creator>
      <dc:date>2021-01-22T14:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713351#M27143</link>
      <description>&lt;P&gt;Hey Tom I am using Text file, can you please help with a code that will help me import all of them at once without using proc import? I need to read all the files&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 14:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713351#M27143</guid>
      <dc:creator>Blandine</dc:creator>
      <dc:date>2021-01-22T14:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713354#M27144</link>
      <description>&lt;P&gt;Post a few lines of one of the files you are trying to read. Use the insert code button (looks like &amp;lt; / &amp;gt; ) to get a pop-up to paste the lines.&amp;nbsp; The files in the link I found for NBI data is NOT a csv file, so you cannot use PROC IMPORT.&amp;nbsp; The data is in fixed locations and they have information about each variable and which columns it is stored on the lines in the text file.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 14:23:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713354#M27144</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-22T14:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713356#M27145</link>
      <description>&lt;P&gt;I modified your code and this is what I used. One thing I realized is that although it imported everything the data are not were it's supposed to be for example Year_built_027 variable is showing other number than the year.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
length filen $256 ;
infile 'C:\Users\bmrg2\Box Sync\Mizzou 2019\Research\SAS Code\Blandine Data\RBI2020\ILLINOIS\IL_Added_inspection_year\*.txt' dsd truncover filename=filen;
input @;
if filen ne lag(filen) then input ;
input STRUCTURE_NUMBER_008 YEAR_BUILT_027 MAINTENANCE_021 OWNER_022 ADT_029 SERVICE_ON_042A SERVICE_UND_042B STRUCTURE_KIND_043A STRUCTURE_TYPE_043B
DECK_STRUCTURE_TYPE_107 DECK_COND_058 SUPERSTRUCTURE_COND_059 SUBSTRUCTURE_COND_060 PERCENT_ADT_TRUCK_109 SCOUR_CRITICAL_113 Inspection_year :$20. ;
filename=filen ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jan 2021 14:26:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713356#M27145</guid>
      <dc:creator>Blandine</dc:creator>
      <dc:date>2021-01-22T14:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713360#M27146</link>
      <description>&lt;PRE&gt;STATE_CODE_001,STRUCTURE_NUMBER_008,RECORD_TYPE_005A,ROUTE_PREFIX_005B,SERVICE_LEVEL_005C,ROUTE_NUMBER_005D,DIRECTION_005E,HIGHWAY_DISTRICT_002,COUNTY_CODE_003,PLACE_CODE_004,FEATURES_DESC_006A,CRITICAL_FACILITY_006B,FACILITY_CARRIED_007,LOCATION_009,MIN_VERT_CLR_010,KILOPOINT_011,BASE_HWY_NETWORK_012,LRS_INV_ROUTE_013A,SUBROUTE_NO_013B,LAT_016,LONG_017,DETOUR_KILOS_019,TOLL_020,MAINTENANCE_021,OWNER_022,FUNCTIONAL_CLASS_026,YEAR_BUILT_027,TRAFFIC_LANES_ON_028A,TRAFFIC_LANES_UND_028B,ADT_029,YEAR_ADT_030,DESIGN_LOAD_031,APPR_WIDTH_MT_032,MEDIAN_CODE_033,DEGREES_SKEW_034,STRUCTURE_FLARED_035,RAILINGS_036A,TRANSITIONS_036B,APPR_RAIL_036C,APPR_RAIL_END_036D,HISTORY_037,NAVIGATION_038,NAV_VERT_CLR_MT_039,NAV_HORR_CLR_MT_040,OPEN_CLOSED_POSTED_041,SERVICE_ON_042A,SERVICE_UND_042B,STRUCTURE_KIND_043A,STRUCTURE_TYPE_043B,APPR_KIND_044A,APPR_TYPE_044B,MAIN_UNIT_SPANS_045,APPR_SPANS_046,HORR_CLR_MT_047,MAX_SPAN_LEN_MT_048,STRUCTURE_LEN_MT_049,LEFT_CURB_MT_050A,RIGHT_CURB_MT_050B,ROADWAY_WIDTH_MT_051,DECK_WIDTH_MT_052,VERT_CLR_OVER_MT_053,VERT_CLR_UND_REF_054A,VERT_CLR_UND_054B,LAT_UND_REF_055A,LAT_UND_MT_055B,LEFT_LAT_UND_MT_056,DECK_COND_058,SUPERSTRUCTURE_COND_059,SUBSTRUCTURE_COND_060,CHANNEL_COND_061,CULVERT_COND_062,OPR_RATING_METH_063,OPERATING_RATING_064,INV_RATING_METH_065,INVENTORY_RATING_066,STRUCTURAL_EVAL_067,DECK_GEOMETRY_EVAL_068,UNDCLRENCE_EVAL_069,POSTING_EVAL_070,WATERWAY_EVAL_071,APPR_ROAD_EVAL_072,WORK_PROPOSED_075A,WORK_DONE_BY_075B,IMP_LEN_MT_076,DATE_OF_INSPECT_090,INSPECT_FREQ_MONTHS_091,FRACTURE_092A,UNDWATER_LOOK_SEE_092B,SPEC_INSPECT_092C,FRACTURE_LAST_DATE_093A,UNDWATER_LAST_DATE_093B,SPEC_LAST_DATE_093C,BRIDGE_IMP_COST_094,ROADWAY_IMP_COST_095,TOTAL_IMP_COST_096,YEAR_OF_IMP_097,OTHER_STATE_CODE_098A,OTHER_STATE_PCNT_098B,OTHR_STATE_STRUC_NO_099,STRAHNET_HIGHWAY_100,PARALLEL_STRUCTURE_101,TRAFFIC_DIRECTION_102,TEMP_STRUCTURE_103,HIGHWAY_SYSTEM_104,FEDERAL_LANDS_105,YEAR_RECONSTRUCTED_106,DECK_STRUCTURE_TYPE_107,SURFACE_TYPE_108A,MEMBRANE_TYPE_108B,DECK_PROTECTION_108C,PERCENT_ADT_TRUCK_109,NATIONAL_NETWORK_110,PIER_PROTECTION_111,BRIDGE_LEN_IND_112,SCOUR_CRITICAL_113,FUTURE_ADT_114,YEAR_OF_FUTURE_ADT_115,MIN_NAV_CLR_MT_116,FED_AGENCY,DATE_LAST_UPDATE,TYPE_LAST_UPDATE,DEDUCT_CODE,REMARKS,PROGRAM_CODE,PROJ_NO,PROJ_SUFFIX,NBI_TYPE_OF_IMP,DTL_TYPE_OF_IMP,SPECIAL_CODE,STEP_CODE,STATUS_WITH_10YR_RULE,SUFFICIENCY_ASTERC,SUFFICIENCY_RATING,STATUS_NO_10YR_RULE
17,000001000200603,1,3,1,00061,0,06,001,36295,'BIG NECK CREEK          ',,'ILL61&amp;amp;94          ','.5 MI N JCT 61 94        ',99.99,,,,,40084200,091040000,0,3,01,01,06,1924,2,0,1200,1991,0,9.8,0,0,0,1,1,1,1,4,0,0,0,A,1,5,1,01,0,00,1,0,9.2,7.6,7.9,0,0,8.8,9.8,99.99,N,0,N,0,0,6,6,6,5,N,,47.7,,27,6,5,N,5,8,8,,,0,791,24,N  ,Y36,N  ,,0791,,0,0,0,2000,,,,0,N,2,,,,1991,1,1,0,0,20,0,,Y,6,1680,2013,,N,,,Z ,,,,0,,,,,0,,84.3,Y
17,000001000300604,1,3,1,00061,0,06,001,36295,'BIG NECK CREEK          ',,'ILL61             ','.1 MI W JCT 61&amp;amp;94        ',99.99,,,,,40080600,091041800,0,3,01,01,06,1925,2,0,650,1991,0,9.1,0,30,0,0,1,0,1,4,0,0,0,A,1,5,1,01,0,00,1,0,9.2,7.9,8.5,0,0,8.8,9.9,99.99,N,0,N,0,0,6,6,5,6,N,,52.2,,28.8,5,5,N,5,7,6,,,0,691,24,N  ,N  ,N  ,,,,0,0,0,2000,,,,0,N,2,,,,0,1,6,0,0,23,0,,Y,6,1120,2013,,N,,,Z ,,,,0,,,,,0,,84.8,Y
17,000001000400605,1,3,1,00061,0,06,001,36295,'BIG NECK CR &lt;/PRE&gt;
&lt;P&gt;Here are the file , there are at least 100 variables I am just keeping about 15 when I import them.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 14:31:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713360#M27146</guid>
      <dc:creator>Blandine</dc:creator>
      <dc:date>2021-01-22T14:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713366#M27147</link>
      <description>&lt;P&gt;Since this is a delimited file you have to read every field (at least up to the last one you actually) want in order to know where to find the values for the variables.&lt;/P&gt;
&lt;P&gt;Personally I would create a program that reads all of the variables.&amp;nbsp; You can then use KEEP= or DROP= dataset options or KEEP or DROP statements to select the variables you want to use for your current analysis.&lt;/P&gt;
&lt;P&gt;But if you want to do something quick and dirty you could just read the fields you want to skip over into a dummy variable that you then drop.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data subset ;
  infile 'myfile.txt' dsd truncover firstobs=2;
  length STATE_CODE_001 8  STRUCTURE_NUMBER_008 $20 HIGHWAY_DISTRICT_002 $20 ;
  length dummy $1 ;
  input STATE_CODE_001 STRUCTURE_NUMBER_008 5*dummy HIGHWAY_DISTRICT_002 ;
  drop dummy;
run;

/*
1 STATE_CODE_001
2 STRUCTURE_NUMBER_008
3 RECORD_TYPE_005A
4 ROUTE_PREFIX_005B
5 SERVICE_LEVEL_005C
6 ROUTE_NUMBER_005D
7 DIRECTION_005E
8 HIGHWAY_DISTRICT_002
*/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 14:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713366#M27147</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-22T14:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713375#M27148</link>
      <description>&lt;P&gt;I am not sure how this step will help me since I have already imported individual files.&lt;/P&gt;
&lt;P&gt;will this step ensure that all the variable are in the same type or what?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 15:16:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713375#M27148</guid>
      <dc:creator>Blandine</dc:creator>
      <dc:date>2021-01-22T15:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import text file doesn't import all my data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713383#M27154</link>
      <description>&lt;P&gt;Yes, re-read the text file and ignore the results of the PROC IMPORT.&amp;nbsp; You can read them one by one or try to use the trick on the other example data step to read all of the files at once into one large dataset.&amp;nbsp; To read all of the files with one data step they must have the fields in the same order on the lines.&amp;nbsp; So if the structure has changed over the years you will want to read them one by one (or group the like files together anyway.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you write your own data step to read the text files then you can be assured that the variables are all created exactly the same.&amp;nbsp; This means that you can combine the dataset if you create them separately.&amp;nbsp; It also means you can prevent variables from being define with the wrong type (numeric or character) or wrong length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the results of the PROC IMPORT to help you figure out how to define the variables in your program.&amp;nbsp; But you probably will want to refer to the definition of the variables as published on the source website.&amp;nbsp; Again some of these fields appear to have only digits in them but they are not NUMBERS.&amp;nbsp; They are identifiers.&amp;nbsp; It will probably be useful to define such variables as character.&amp;nbsp; That is the problem with using PROC IMPORT. A text file has no place to store the attributes of the variables so PROC IMPORT just guesses what to do based the values it checks.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 15:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-Import-text-file-doesn-t-import-all-my-data/m-p/713383#M27154</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-22T15:40:51Z</dc:date>
    </item>
  </channel>
</rss>

