<?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: I want a help on this error message in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785176#M250562</link>
    <description>&lt;P&gt;Thanks for the repply, I'm using a virtual machine.&lt;/P&gt;&lt;P&gt;My code :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data mydata.exercice1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set mydata.exercice1 ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;homme = 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if genre = 1 then homme = 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;femme= 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if genre = 2 then femme = 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;homme = 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc freq data = mydata.exercice1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tables genre*homme &amp;nbsp;genre* femme;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Error messages :&amp;nbsp;&lt;/P&gt;&lt;P&gt;- User does not have appropriate authorization level for library&lt;/P&gt;&lt;P&gt;- Error: variable FEMME not found&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Error: variable FOMME not found&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you look at it again please?&lt;/P&gt;</description>
    <pubDate>Thu, 09 Dec 2021 16:18:09 GMT</pubDate>
    <dc:creator>mateckma</dc:creator>
    <dc:date>2021-12-09T16:18:09Z</dc:date>
    <item>
      <title>I want a help on this error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785165#M250557</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please I want to create factice variables but this error message is displayed, can someone help me ?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mateckma_3-1639064676515.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66563iDC120440F31A88C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mateckma_3-1639064676515.png" alt="mateckma_3-1639064676515.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 15:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785165#M250557</guid>
      <dc:creator>mateckma</dc:creator>
      <dc:date>2021-12-09T15:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: I want a help on this error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785167#M250558</link>
      <description>&lt;P&gt;You don't have write access to library MYDATA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data exercicel;
    set mydata.exercicel;
... the rest of your code goes here ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the future, please show us the whole log, as text (not as a screen capture). Copy the log as text and paste it into the window that appears when you click on the &amp;lt;/&amp;gt; icon. Thanks.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Insert Log Icon in SAS Communities.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66171iFEC370B1DBF07B28/image-size/large?v=v2&amp;amp;px=999" role="button" title="Insert Log Icon in SAS Communities.png" alt="Insert Log Icon in SAS Communities.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 16:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785167#M250558</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-09T16:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: I want a help on this error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785176#M250562</link>
      <description>&lt;P&gt;Thanks for the repply, I'm using a virtual machine.&lt;/P&gt;&lt;P&gt;My code :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data mydata.exercice1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set mydata.exercice1 ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;homme = 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if genre = 1 then homme = 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;femme= 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if genre = 2 then femme = 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;homme = 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc freq data = mydata.exercice1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tables genre*homme &amp;nbsp;genre* femme;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Error messages :&amp;nbsp;&lt;/P&gt;&lt;P&gt;- User does not have appropriate authorization level for library&lt;/P&gt;&lt;P&gt;- Error: variable FEMME not found&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Error: variable FOMME not found&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you look at it again please?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 16:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785176#M250562</guid>
      <dc:creator>mateckma</dc:creator>
      <dc:date>2021-12-09T16:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: I want a help on this error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785182#M250565</link>
      <description>&lt;P&gt;Okay, I wanted to see the log, not the code. I wanted the log pasted into the window that appears when you click on the &amp;lt;/&amp;gt; icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not split the log. Do not show us partial logs. Show us the entire log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, I already explained the first error. Since you have the first error, your variable FEMME and HOMME do not get created, and so these variable cannot be used until you fix the first error.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 16:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785182#M250565</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-09T16:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: I want a help on this error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785183#M250566</link>
      <description>&lt;P&gt;You likely have only READ access to the MYDATA folder.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise the code you wrote would replace the exercise1 data in that folder and anyone else using it would now have a different data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;suggested, try writing it to the work library instead.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general, never use this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data mydata.exercice1; &amp;lt;- Input data set&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;set mydata.exercice1 ; &amp;lt;- output data set&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If you make a mistake you ruin the original dataset and have to recreate it from scratch. For class work that's easy but you can't always recreate a data set.&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/409405"&gt;@mateckma&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for the repply, I'm using a virtual machine.&lt;/P&gt;
&lt;P&gt;My code :&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data mydata.exercice1;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;set mydata.exercice1 ;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;homme = 0;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if genre = 1 then homme = 1;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;femme= 0;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if genre = 2 then femme = 1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;homme = 0;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc freq data = mydata.exercice1;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;tables genre*homme &amp;nbsp;genre* femme;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Error messages :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- User does not have appropriate authorization level for library&lt;/P&gt;
&lt;P&gt;- Error: variable FEMME not found&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Error: variable FOMME not found&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you look at it again please?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data exercice1_ans;

set mydata.exercice1 ;

homme = 0;

if genre = 1 then homme = 1;

femme= 0;

if genre = 2 then femme = 1

homme = 0;

run;

proc freq data = exercice1_ans;

tables genre*homme  genre* femme;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What happens if you try this?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 16:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785183#M250566</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-12-09T16:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: I want a help on this error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785199#M250570</link>
      <description>&lt;P&gt;Thanks a lots,&amp;nbsp;It runs now,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use a virtual machine, when I copy the log to past out of the box (every where as a text), it doesn't work so, I must type all the log, I'm sorry for that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 16:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785199#M250570</guid>
      <dc:creator>mateckma</dc:creator>
      <dc:date>2021-12-09T16:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: I want a help on this error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785365#M250637</link>
      <description>&lt;P&gt;You may have gotten your code to work. But I am pretty sure it does not do what is wanted. You should not have the final "homme=0" statement, because it means that the variable HOMME is always set to 0. And then the exercise of setting to 1 if GENRE=1 is wasted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can see that you are pretty new to SAS. You should learn to use the ELSE statement, I think you can get the correct output like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data exercice1;
  set mydata.exercice1;
  if genre=1 then homme=1;
  else homme=0;
  if genre=2 then femme=1;
  else femme=0;
run;   &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or, a bit more fast and dirty: a logical expression in SAS evaluates to 1 (true) or 0 (false). So this could also be written as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data exercice1;
  set mydata.exercice1;
  homme=genre=1;
  femme=genre=2;
run;   &lt;/CODE&gt;&lt;/PRE&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>Fri, 10 Dec 2021 11:23:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-a-help-on-this-error-message/m-p/785365#M250637</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2021-12-10T11:23:43Z</dc:date>
    </item>
  </channel>
</rss>

