<?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: how to use data_null_ to see a few of observations of a external file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583733#M166202</link>
    <description>&lt;P&gt;My log shows as&lt;/P&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;2 Europe AL Albania 36&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;4 Australia AS American Samoa 43&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;6 Africa AO Angola 35&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;8 Antarctica AQ Antarctica 39&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;10 South America AR Argentina 38&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: 10 records were read from the infile WORLD.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;The minimum record length was 35.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;The maximum record length was 48.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;and the files shows as&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;South America BO Bolivia&lt;BR /&gt;North America BQ Bonaire, Sint Eustatius and Saba&lt;BR /&gt;Europe BA Bosnia and Herzegovina&lt;BR /&gt;Africa BW Botswana&lt;BR /&gt;Antarctica BV Bouvet Island&lt;BR /&gt;South America BR Brazil&lt;BR /&gt;Asia IO British Indian Ocean Territory&lt;BR /&gt;Asia BN Brunei&lt;BR /&gt;Europe BG Bulgaria&lt;BR /&gt;Africa BF Burkina Faso&lt;BR /&gt;Africa BI Burundi&lt;BR /&gt;Asia KH Cambodia&lt;BR /&gt;Africa CM Cameroon&lt;BR /&gt;Africa CM_NG Cameroon/Nigeria&lt;BR /&gt;North America CA Canada&lt;BR /&gt;Africa CV Cape Verde&lt;BR /&gt;North America KY Cayman Islands&lt;BR /&gt;Africa CF Central African Republic&lt;BR /&gt;Africa TD Chad&lt;BR /&gt;South America CL Chile&lt;BR /&gt;Asia CN China&lt;BR /&gt;Asia CN_IN China/India&lt;BR /&gt;Asia CN_TW China/Taiwan_POC&lt;BR /&gt;Asia CN_VN China/Viet_Nam&lt;BR /&gt;Asia CX Christmas Island&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Thank you so much for your help&lt;/DIV&gt;</description>
    <pubDate>Sun, 25 Aug 2019 06:29:06 GMT</pubDate>
    <dc:creator>YangYY</dc:creator>
    <dc:date>2019-08-25T06:29:06Z</dc:date>
    <item>
      <title>how to use data_null_ to see a few of observations of a external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583727#M166198</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know how to use the data_null_to have a look at the first few lines of a external file.&lt;/P&gt;&lt;P&gt;I know I should use option obs and statement List, but I have no idea how to let sas read the file by using data_null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2019 04:32:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583727#M166198</guid>
      <dc:creator>YangYY</dc:creator>
      <dc:date>2019-08-25T04:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to use data_null_ to see a few of observations of a external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583730#M166199</link>
      <description>&lt;P&gt;You can do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
infile "insert full path here";
input;
put _infile_;
if _n_ = 5 then stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I find it much better to use a proper text editor (eg notepad++) to inspect files.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2019 05:48:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583730#M166199</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-08-25T05:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to use data_null_ to see a few of observations of a external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583731#M166200</link>
      <description>&lt;P&gt;Thank you for your rely and it is helpful!&lt;/P&gt;&lt;P&gt;But I've found another problem after trying this.&lt;/P&gt;&lt;P&gt;I was asked to use data_null_and OBS and LIST to have a look at the first few lines of the given file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;infile world obs=10;&lt;BR /&gt;input continent $1-20 abbreviation $21-29 country_name $30-50;&lt;BR /&gt;list;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The log shows as picture 1 and it is different from the first few lines of the given file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The given file is also been uploaded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2019 06:19:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583731#M166200</guid>
      <dc:creator>YangYY</dc:creator>
      <dc:date>2019-08-25T06:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to use data_null_ to see a few of observations of a external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583733#M166202</link>
      <description>&lt;P&gt;My log shows as&lt;/P&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;2 Europe AL Albania 36&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;4 Australia AS American Samoa 43&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;6 Africa AO Angola 35&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;8 Antarctica AQ Antarctica 39&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;10 South America AR Argentina 38&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: 10 records were read from the infile WORLD.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;The minimum record length was 35.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;The maximum record length was 48.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;and the files shows as&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;South America BO Bolivia&lt;BR /&gt;North America BQ Bonaire, Sint Eustatius and Saba&lt;BR /&gt;Europe BA Bosnia and Herzegovina&lt;BR /&gt;Africa BW Botswana&lt;BR /&gt;Antarctica BV Bouvet Island&lt;BR /&gt;South America BR Brazil&lt;BR /&gt;Asia IO British Indian Ocean Territory&lt;BR /&gt;Asia BN Brunei&lt;BR /&gt;Europe BG Bulgaria&lt;BR /&gt;Africa BF Burkina Faso&lt;BR /&gt;Africa BI Burundi&lt;BR /&gt;Asia KH Cambodia&lt;BR /&gt;Africa CM Cameroon&lt;BR /&gt;Africa CM_NG Cameroon/Nigeria&lt;BR /&gt;North America CA Canada&lt;BR /&gt;Africa CV Cape Verde&lt;BR /&gt;North America KY Cayman Islands&lt;BR /&gt;Africa CF Central African Republic&lt;BR /&gt;Africa TD Chad&lt;BR /&gt;South America CL Chile&lt;BR /&gt;Asia CN China&lt;BR /&gt;Asia CN_IN China/India&lt;BR /&gt;Asia CN_TW China/Taiwan_POC&lt;BR /&gt;Asia CN_VN China/Viet_Nam&lt;BR /&gt;Asia CX Christmas Island&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Thank you so much for your help&lt;/DIV&gt;</description>
      <pubDate>Sun, 25 Aug 2019 06:29:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583733#M166202</guid>
      <dc:creator>YangYY</dc:creator>
      <dc:date>2019-08-25T06:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to use data_null_ to see a few of observations of a external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583735#M166204</link>
      <description>&lt;P&gt;Do not post infile data in the main posting window, use the {i} button for this. This is necessary to keep horizontal positioning and special characters (eg tabs) as is.&lt;/P&gt;
&lt;P&gt;And once again, it is much easier to view the text file with a good editor to see what it contains. Such editors have options to view the hex codes, which help greatly in determining what is used for delimiters etc.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2019 07:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583735#M166204</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-08-25T07:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to use data_null_ to see a few of observations of a external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583776#M166219</link>
      <description>&lt;P&gt;Your file isn't showing delimiters that I can see, my guess is it's tab delimited?&lt;/P&gt;
&lt;P&gt;How will American Samoa be read in because of the spaces? I suspect that's causing your issues.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you're reading in a file to see the format you should not specify the variables in the INPUT statement. When you do that you're already making assumptions on the data which could be incorrect.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want to see the actual values so a plain INPUT statement is what you need. Modify your code as following and see if it works for you:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
infile world obs=10;
&lt;STRONG&gt;&lt;FONT size="5" color="#FF6600"&gt;input;&lt;/FONT&gt;&lt;/STRONG&gt;
list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/284230"&gt;@YangYY&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your rely and it is helpful!&lt;/P&gt;
&lt;P&gt;But I've found another problem after trying this.&lt;/P&gt;
&lt;P&gt;I was asked to use data_null_and OBS and LIST to have a look at the first few lines of the given file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;infile world obs=10;&lt;BR /&gt;input continent $1-20 abbreviation $21-29 country_name $30-50;&lt;BR /&gt;list;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log shows as picture 1 and it is different from the first few lines of the given file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The given file is also been uploaded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2019 17:06:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583776#M166219</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-25T17:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to use data_null_ to see a few of observations of a external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583801#M166228</link>
      <description>Thank you so much!!!&lt;BR /&gt;My problems got solved!!</description>
      <pubDate>Mon, 26 Aug 2019 00:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-data-null-to-see-a-few-of-observations-of-a-external/m-p/583801#M166228</guid>
      <dc:creator>YangYY</dc:creator>
      <dc:date>2019-08-26T00:46:53Z</dc:date>
    </item>
  </channel>
</rss>

