<?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: insert values using proc sql with conditionaly in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869210#M343356</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That something can't or shouldn't be done is precious knowledge. And being told so is not convincing for some. I suspect that such is the purpose of this exercise.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I also wonder how well the poster is translating or understanding the original assignment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Juola's metatheroem: You will seldom misunderstand a problem so as to make it simpler.&lt;/P&gt;
&lt;P&gt;Dr. Robert Juola was my first professor in statistics and made this comment after several assignments ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Apr 2023 20:17:00 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-04-11T20:17:00Z</dc:date>
    <item>
      <title>insert values using proc sql with conditionaly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/868823#M343232</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data insertvalues;
set sashelp.class;
run;


data newvalues;
set insertvalues  ;
 output; 
if mod(_n_,2)=0 then do  ;
 name='Anand';
 sex='M';
 age=16;
 Height= 8.11 ;	Weight= 54.22;
 output;
 end;
 proc print;
 run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;how to insert values conditionally in proc sql&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 07:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/868823#M343232</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-04-10T07:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: insert values using proc sql with conditionaly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/868825#M343233</link>
      <description>&lt;P&gt;Maxim 14. Use the Right Tool.&lt;/P&gt;
&lt;P&gt;Here, it is the data step, which you already use. Forget SQL whenever sequence matters, and using it here would be pure idiocy.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 08:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/868825#M343233</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-10T08:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: insert values using proc sql with conditionaly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/868841#M343238</link>
      <description>&lt;P&gt;If this is another of your useless homeworks (what imbecile comes up with such stupid exercises for things you will NEVER do in real life, and where the time could have been used for teaching meaningful things like hash objects, instead of being a total waste?), here some hints:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Use OUTER UNION CORR to stack the dataset with itself&lt;/LI&gt;
&lt;LI&gt;as the first source, use the variables as they are, and create a new one (_name) from name, and another (_flag) as 0&lt;/LI&gt;
&lt;LI&gt;as the second source, use name as _name, create all others (name,sex,age,height,weight) with your values, and _flag as 1&lt;/LI&gt;
&lt;LI&gt;order by _name and _flag&lt;/LI&gt;
&lt;LI&gt;drop both new variables with a dataset option from the result&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;As you will see, the code will be unwieldy and ugly as hell, and just an illustration what being a total idiot entices. Scratch this experience from your memory ASAP, it only wastes precious neurons.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 11:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/868841#M343238</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-10T11:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: insert values using proc sql with conditionaly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/868848#M343242</link>
      <description>You can't "insert values conditionally in proc sql".&lt;BR /&gt;INSERT statement in SQL is like PROC APPEND, can't like data step update obs conditionally.</description>
      <pubDate>Mon, 10 Apr 2023 11:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/868848#M343242</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-04-10T11:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: insert values using proc sql with conditionaly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869082#M343308</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;there is a way...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL ;
   CREATE VIEW CLASS AS
      SELECT monotonic() AS _N_,*
      FROM sashelp.class
   ;
   CREATE VIEW class_hlp AS
      SELECT monotonic()+.1 AS _N_,
             'Anand' AS name,
             'M' AS sex,
             16 AS age,
             8.11 AS Height,
             54.22 AS Weight
      FROM CLASS
   ;
   CREATE TABLE want(DROP=_N_) AS
      SELECT *
      FROM CLASS
      UNION CORRESPONDING ALL
      SELECT *
      FROM class_hlp
      WHERE (mod(int(_N_), 2)=0)
      ORDER BY _N_
   ;
   DROP VIEW class, class_hlp;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Apr 2023 11:49:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869082#M343308</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2023-04-11T11:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: insert values using proc sql with conditionaly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869088#M343312</link>
      <description>You create a NEW dataset ,not insert into original dataset .</description>
      <pubDate>Tue, 11 Apr 2023 11:54:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869088#M343312</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-04-11T11:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: insert values using proc sql with conditionaly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869107#M343318</link>
      <description>&lt;P&gt;That's exactly what I do &lt;span class="lia-unicode-emoji" title=":hugging_face:"&gt;🤗&lt;/span&gt; and meet the requirement&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I conditionally insert values in a dataset with PROC SQL&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 13:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869107#M343318</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2023-04-11T13:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: insert values using proc sql with conditionaly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869165#M343338</link>
      <description>&lt;P&gt;That something can't or shouldn't be done is precious knowledge. And being told so is not convincing for some. I suspect that such is the purpose of this exercise.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 17:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869165#M343338</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2023-04-11T17:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: insert values using proc sql with conditionaly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869172#M343345</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That something can't or shouldn't be done is precious knowledge. And being told so is not convincing for some. I suspect that such is the purpose of this exercise.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;True, true.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 18:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869172#M343345</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-11T18:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: insert values using proc sql with conditionaly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869210#M343356</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That something can't or shouldn't be done is precious knowledge. And being told so is not convincing for some. I suspect that such is the purpose of this exercise.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I also wonder how well the poster is translating or understanding the original assignment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Juola's metatheroem: You will seldom misunderstand a problem so as to make it simpler.&lt;/P&gt;
&lt;P&gt;Dr. Robert Juola was my first professor in statistics and made this comment after several assignments ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 20:17:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insert-values-using-proc-sql-with-conditionaly/m-p/869210#M343356</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-04-11T20:17:00Z</dc:date>
    </item>
  </channel>
</rss>

