<?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: SAS not able to read data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335601#M75989</link>
    <description>&lt;P&gt;In most data steps, you have to specify where your data should be read from and where it should be written out to (there are some exceptions like data _null_, but that is besides the point right now). The data statement only specifies where to *write* to, you need a set or an input statement to specify where to *read* the data from. No data to read in = no data to write out (unless you are generating data in that very data step).&lt;/P&gt;</description>
    <pubDate>Fri, 24 Feb 2017 14:47:08 GMT</pubDate>
    <dc:creator>nehalsanghvi</dc:creator>
    <dc:date>2017-02-24T14:47:08Z</dc:date>
    <item>
      <title>SAS not able to read data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335585#M75975</link>
      <description>&lt;P&gt;I have a dataset with the variable id and gcstot&amp;nbsp;( numerical score). Everytime I am trying to create a new variable using gcstot&amp;nbsp;its giving me an&amp;nbsp;error message that gcstot&amp;nbsp;is uninitiated, even though its already there on the original dataset. The original dataset is as below. I am trying to run the &lt;STRONG&gt;code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;data trs2;&lt;BR /&gt;gcs = gcstot*2;&lt;BR /&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is giving me the output as&amp;nbsp;&lt;/P&gt;&lt;DIV class="dgrid-header dgrid-header-row ui-widget-header"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;gcstot &amp;nbsp; &amp;nbsp;gcs &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="dgrid-scroller"&gt;&lt;DIV class="dgrid-content ui-widget-content"&gt;&lt;DIV class=" dgrid-row ui-state-default dgrid-row-even dgrid-selected ui-state-active"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Log:&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV class="sasNote"&gt;Variable gcstot is uninitialized.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;1 at 57:13&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&lt;STRONG&gt;Dataset&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;obs &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;gcstot&lt;/P&gt;&lt;DIV class=" dgrid-row dgrid-row-even ui-state-default"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;TD&gt;-1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-odd ui-state-default"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-even ui-state-default"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-odd ui-state-default"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-even ui-state-default"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;17&lt;/TD&gt;&lt;TD&gt;-2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-odd ui-state-default"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-even ui-state-default"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-odd ui-state-default dgrid-selected ui-state-active"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335585#M75975</guid>
      <dc:creator>Shravani0</dc:creator>
      <dc:date>2017-02-24T14:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS not able to read data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335586#M75976</link>
      <description>&lt;P&gt;Your data step does not have a set statement which is required if you are trying to read in data from a certain dataset. The data statement specifies which dataset to *write* out to, it does not read data. This is what you need:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data trs2;
set trs2;
gcs = gcstot*2;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:15:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335586#M75976</guid>
      <dc:creator>nehalsanghvi</dc:creator>
      <dc:date>2017-02-24T14:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS not able to read data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335589#M75979</link>
      <description>&lt;P&gt;Thanks for your reply. But I have already done that in the previous data step.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335589#M75979</guid>
      <dc:creator>Shravani0</dc:creator>
      <dc:date>2017-02-24T14:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS not able to read data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335590#M75980</link>
      <description>&lt;P&gt;Haha likely the title "SAS not able to read data" is the most tantalizing of all as that would be a first. In my 30 years of SAS that has not yet happened.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Luckily in this case it will also not happen &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What we see is a datastep where you forgot to refer to an input dataset. Now your variable gcstot was never given a value. The result makes sense: a missing value (the dot) for both gcstot and gcs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you meant to code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data trs2;
&lt;STRONG&gt;set yourinput;&lt;/STRONG&gt;
gcs = gcstot*2;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When yourinput contains variable gcstot that will be read and the clculation will yield a non-missing value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards Jan&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:19:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335590#M75980</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2017-02-24T14:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS not able to read data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335592#M75981</link>
      <description>&lt;P&gt;You have to specify a set statement every time you are trying to read a dataset (i.e. in each new data step). Not just once.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335592#M75981</guid>
      <dc:creator>nehalsanghvi</dc:creator>
      <dc:date>2017-02-24T14:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS not able to read data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335594#M75982</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your contribution. This is my SAS code what I am trying to run. I don't really see a problem with set statement here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import out = triss1&lt;BR /&gt;datafile = "/home/srawanisarkar0/sasuser.v94/triss1.csv"&lt;BR /&gt;DBMS = csv replace;&lt;BR /&gt;getnames = yes;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data trs1;&lt;BR /&gt;set triss1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc means data = trs1;&lt;BR /&gt;var gcstot;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data trs2;&lt;BR /&gt;set trs1;&lt;BR /&gt;keep inc_key gcstot;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data trs2;&lt;BR /&gt;gcs = gcstot*2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;shr&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335594#M75982</guid>
      <dc:creator>Shravani0</dc:creator>
      <dc:date>2017-02-24T14:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS not able to read data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335595#M75983</link>
      <description>&lt;P&gt;Yes, you need a set statemenet in that last data step. Try ou the code I sent before:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;set trs2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335595#M75983</guid>
      <dc:creator>nehalsanghvi</dc:creator>
      <dc:date>2017-02-24T14:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS not able to read data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335597#M75985</link>
      <description>&lt;P&gt;You can also combine the last&amp;nbsp;two data steps into one, like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data trs2;
set trs1;
gcs = gcstot*2;
keep inc_key gcstot gcs;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You do not need to do the calculation in a brand new data step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335597#M75985</guid>
      <dc:creator>nehalsanghvi</dc:creator>
      <dc:date>2017-02-24T14:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAS not able to read data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335600#M75988</link>
      <description>&lt;P&gt;Great. Thanks! I didn't know I need a set statement everytime I use the dataset. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335600#M75988</guid>
      <dc:creator>Shravani0</dc:creator>
      <dc:date>2017-02-24T14:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS not able to read data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335601#M75989</link>
      <description>&lt;P&gt;In most data steps, you have to specify where your data should be read from and where it should be written out to (there are some exceptions like data _null_, but that is besides the point right now). The data statement only specifies where to *write* to, you need a set or an input statement to specify where to *read* the data from. No data to read in = no data to write out (unless you are generating data in that very data step).&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:47:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-not-able-to-read-data/m-p/335601#M75989</guid>
      <dc:creator>nehalsanghvi</dc:creator>
      <dc:date>2017-02-24T14:47:08Z</dc:date>
    </item>
  </channel>
</rss>

