<?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: Inserting observation to a dataset using PROC SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159436#M263171</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just replace the reference to the variable with this function call.&lt;/P&gt;&lt;P&gt;put(compDate,mmddyy10.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Sep 2014 14:25:17 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2014-09-25T14:25:17Z</dc:date>
    <item>
      <title>Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159425#M263160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset (named "problems") with few variables ID, date, Note&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to run PROC SQL to query another database dataset and based on that query I update (problems) from the query I run, so that ID = ID from the query, Date = date from the query, and Note = (some other data pulled from the query in the form of "Complete=yes/no&amp;nbsp; Dropped=yes/not") with Complete, and Dropped being two separate variables in the database&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Note&lt;/P&gt;&lt;P&gt;---------------------------&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Complete=yes Dropped =no&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2/6/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Complete=n Dropped =no&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;having trouble with syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz help...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 11:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159425#M263160</guid>
      <dc:creator>Altal</dc:creator>
      <dc:date>2014-09-25T11:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159426#M263161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like (note its really a bit of guess as you haven't supplied much information):&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table WANT as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COALESCE(A.ID,B.ID) as ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COALESCE(A.DATE,B.DATE) as DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Complete="||case when A.VAL is not null then "yes" else "no" end||&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; " Dropped="||case when B.VAL is not null then "yes" else "no" end as NOTE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA1 A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; full join&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA2 B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A.ID=B.ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A.DATE=B.DATE;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 12:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159426#M263161</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-25T12:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159427#M263162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Roy - there is no join required; "Problem" is an empty dataset, that I want to update along the program (using INSERT statement in proc sql) by looking into other dataset and doing some queries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Completed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dropped&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/6/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; no&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3/6/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so I just want to query the data above and insert these into an existing data called "problem" that has 3 variables (ID, Date, Note)&lt;/P&gt;&lt;P&gt;so that the output would be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp; Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Note&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Completed=yes&amp;nbsp; Dropped=yes&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/6/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Completed=yes&amp;nbsp; Dropped=no&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3/6/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Completed=yes&amp;nbsp; Dropped=yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this explains it better..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 12:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159427#M263162</guid>
      <dc:creator>Altal</dc:creator>
      <dc:date>2014-09-25T12:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159428#M263163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, (pretend I am Roy for a bit :smileyshocked:)&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert into PROBLEM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Completed="||strip(COMPLETED)||" Dropped="||strip(DROPPED) as NOTE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HAVE;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 12:45:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159428#M263163</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-25T12:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159429#M263164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could of course just use normal SAS steps instead of SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; id date &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;8&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; completed dropped &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;$3.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;informat&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; date &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; date &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; id date completed dropped;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/6/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; no&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3/6/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; to_insert / &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;view&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=to_insert;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; note $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;50&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; note = catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'='&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'Completed'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,completed),catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'='&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'Dropped'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,dropped));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;keep&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; id date note;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;append&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=to_insert &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;base&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=problems;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 13:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159429#M263164</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-25T13:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159430#M263165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why we've used '||' operator whilst calculating the variable completed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;"Completed="||strip(COMPLETED)||" Dropped="||strip(DROPPED) as NOTE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Also you've used two '||' for the first strip function and one || for the second strip function. Why so?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 13:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159430#M263165</guid>
      <dc:creator>RamKumar</dc:creator>
      <dc:date>2014-09-25T13:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159431#M263166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to you guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom is there away to circumvent this error, without inserting same number of variables in the dataset?&lt;/P&gt;&lt;P&gt;ERROR: Attempt to insert fewer columns than specified after the INSERT table name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 13:41:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159431#M263166</guid>
      <dc:creator>Altal</dc:creator>
      <dc:date>2014-09-25T13:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159432#M263167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;|| means concatenate the string on the left of the operator to the string on the right of the operator, the operator being ||.&amp;nbsp; So I want to concatenate "Completed=" and the variable completed, and the result of than concatenated with " Dropped=" and then concatenated with the variable DROPPED.&amp;nbsp; So three concatenators for four items.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 13:54:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159432#M263167</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-25T13:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159433#M263168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are writing an SQL insert statement you should list the variables that you are inserting into. This will solve issue of trying to provide values for only some of the variables.&amp;nbsp; It will also allow you to not care what order the variables are on the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002294531.htm" title="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002294531.htm"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002294531.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert into problems (id,date,note)&lt;/P&gt;&lt;P&gt;select id,date,catx(' ',catx('=','Completed',completed),catx('=','Dropped',dropped))&lt;/P&gt;&lt;P&gt;from HAVE&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 14:05:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159433#M263168</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-25T14:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159434#M263169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, RW9, don't know why had the impression you're Roy &amp;gt;&amp;lt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 14:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159434#M263169</guid>
      <dc:creator>Altal</dc:creator>
      <dc:date>2014-09-25T14:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159435#M263170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Tom this is very helpful...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added one more variable (a date variable) to the last inside the CATX, but it shows as number 19389 for example, how can I put is as a date (mmddyy10.)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;catx(' ',catx('=','Completed',completed),catx('=','Dropped',dropped), &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;catx('=','Completion Date',compDate)&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 14:22:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159435#M263170</guid>
      <dc:creator>Altal</dc:creator>
      <dc:date>2014-09-25T14:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting observation to a dataset using PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159436#M263171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just replace the reference to the variable with this function call.&lt;/P&gt;&lt;P&gt;put(compDate,mmddyy10.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 14:25:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-observation-to-a-dataset-using-PROC-SQL/m-p/159436#M263171</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-25T14:25:17Z</dc:date>
    </item>
  </channel>
</rss>

