<?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: understanding value assignment IF and PDV for this code? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/482251#M124866</link>
    <description>here is the original source of the question -&lt;BR /&gt;&lt;A href="http://support.sas.com/training/us/crs/quiz/prg1/chapter9x.htm" target="_blank"&gt;http://support.sas.com/training/us/crs/quiz/prg1/chapter9x.htm&lt;/A&gt;</description>
    <pubDate>Sun, 29 Jul 2018 07:29:50 GMT</pubDate>
    <dc:creator>pjpnk</dc:creator>
    <dc:date>2018-07-29T07:29:50Z</dc:date>
    <item>
      <title>understanding value assignment IF and PDV for this code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/480929#M124319</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hello - I am stuck here can someone please explain what would be the answer?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Based on this program and the observation shown in the PDV, what variable’s value is assigned to&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;PDV&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&g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gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;data payroll;
&amp;nbsp; &amp;nbsp;set salaries;
&amp;nbsp; &amp;nbsp;if PayClass='Monthly' then Amount=Salary;
&amp;nbsp; &amp;nbsp;else if PayClass='Hourly' then do;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Amount=HrlyWage*Hrs;
&amp;nbsp; &amp;nbsp; &amp;nbsp; if Hrs&amp;gt;40 then Msg='CHECK TIMECARD';&amp;nbsp;
&amp;nbsp; &amp;nbsp;end;&amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp;else Amount=JobRate;
run;&lt;/PRE&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;a.)not specified&lt;/DIV&gt;&lt;DIV&gt;b.)HrlyWage*Hrs&lt;/DIV&gt;&lt;DIV&gt;c.)JobRate&lt;/DIV&gt;&lt;DIV&gt;d.)Salary&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any help would be appreciated.&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Jul 2018 19:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/480929#M124319</guid>
      <dc:creator>pjpnk</dc:creator>
      <dc:date>2018-07-24T19:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: understanding value assignment IF and PDV for this code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/480936#M124321</link>
      <description>&lt;P&gt;Who asked you this question?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you think is the answer and why?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 20:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/480936#M124321</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-24T20:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: understanding value assignment IF and PDV for this code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/480938#M124322</link>
      <description>&lt;P&gt;sorry..! while practice I got this question and the answer given is the option D (Salary) as correct. but I am confused.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 20:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/480938#M124322</guid>
      <dc:creator>pjpnk</dc:creator>
      <dc:date>2018-07-24T20:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: understanding value assignment IF and PDV for this code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/480948#M124324</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/194560"&gt;@pjpnk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;sorry..! while practice I got this question and the answer given is the option D (Salary) as correct. but I am confused.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would go back to the source and verify that the PDV you show is accurate. Since you don't show a variable SALARY in the PDV then something is odd. If there actually is not variable SALARY in the dataset SALARIES then this line would create the variable SALARY with a missing value:&lt;/P&gt;
&lt;PRE&gt;if PayClass='Monthly' then Amount=Salary;
&lt;/PRE&gt;
&lt;P&gt;and a note about SALARY was uninitialized.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At which point SALARY = JOBRATE (both missing).&lt;/P&gt;
&lt;P&gt;But since the PDV is ALSO missing HrlyWage I suspect that your PDV description is incomplete.&lt;/P&gt;
&lt;P&gt;One common test of doubtful questions is to create the "data" and run the code:&lt;/P&gt;
&lt;PRE&gt;data salaries;
   empid='1201';
   payclass='Contract';
   hrs = 30;
   amount=.;
   jobrate=.;
   msg = '   ';
run;
   
data payroll;
   set salaries;
   if PayClass='Monthly' then Amount=Salary;
   else if PayClass='Hourly' then do;
      Amount=HrlyWage*Hrs;
      if Hrs&amp;gt;40 then Msg='CHECK TIMECARD'; 
   end;     
   else Amount=JobRate;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jul 2018 20:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/480948#M124324</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-24T20:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: understanding value assignment IF and PDV for this code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/480949#M124325</link>
      <description>&lt;P&gt;Actually, the PDV doesn't match the program.&amp;nbsp; If it did, it would also contain a spot for Salary and HrlyWage.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 20:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/480949#M124325</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-24T20:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: understanding value assignment IF and PDV for this code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/482251#M124866</link>
      <description>here is the original source of the question -&lt;BR /&gt;&lt;A href="http://support.sas.com/training/us/crs/quiz/prg1/chapter9x.htm" target="_blank"&gt;http://support.sas.com/training/us/crs/quiz/prg1/chapter9x.htm&lt;/A&gt;</description>
      <pubDate>Sun, 29 Jul 2018 07:29:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/482251#M124866</guid>
      <dc:creator>pjpnk</dc:creator>
      <dc:date>2018-07-29T07:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: understanding value assignment IF and PDV for this code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/482252#M124867</link>
      <description>&lt;P&gt;here is the original source of the question -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/training/us/crs/quiz/prg1/chapter9x.htm" target="_blank"&gt;http://support.sas.com/training/us/crs/quiz/prg1/chapter9x.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 07:30:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/482252#M124867</guid>
      <dc:creator>pjpnk</dc:creator>
      <dc:date>2018-07-29T07:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: understanding value assignment IF and PDV for this code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/482278#M124885</link>
      <description>&lt;P&gt;That's the source of your confusion.&amp;nbsp; Your link does not select D as the correct answer, but selects C instead.&amp;nbsp; C is correct.&amp;nbsp; The first two IF/THEN conditions are false, so the last statement in the DATA step executes.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 13:36:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/understanding-value-assignment-IF-and-PDV-for-this-code/m-p/482278#M124885</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-29T13:36:50Z</dc:date>
    </item>
  </channel>
</rss>

