<?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: Trying to insert hard-code row into table in data prep in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Trying-to-insert-hard-code-row-into-table-in-data-prep/m-p/533880#M11867</link>
    <description>&lt;P&gt;As I can recall, SELECT requires a FROM clause.&lt;/P&gt;
&lt;P&gt;So you might need to refer to a row stored in an existing table, rather than hard code the values.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Feb 2019 10:47:06 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2019-02-08T10:47:06Z</dc:date>
    <item>
      <title>Trying to insert hard-code row into table in data prep</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Trying-to-insert-hard-code-row-into-table-in-data-prep/m-p/533692#M11864</link>
      <description>&lt;P&gt;In Data Prep, I have the following code which is working great:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
create view TEMP_LASR_VIEW_1234 as

SELECT
   X.EmployeeID,
   X.EmployeeName
FROM
   LASRLIB.MyTable X

quit;

/* Drop existing table */
%vdb_dt(LASRLIB.EMPLOYEES);
data LASRLIB.EMPLOYEES (    );
               set TEMP_LASR_VIEW_1234 (  );
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now I want to alter this code to insert a hard-coded row in the same data prep script. I tried doing a UNION statement:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SELECT
   X.EmployeeID,
   X.EmployeeName
FROM
   LASRLIB.MyTable X

UNION

SELECT
0,
'EMPTY ROW'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i keep getting the "&lt;CODE class=" language-sas"&gt;Syntax error, expecting one of the following: a quoted string, ',', AS, FORMAT, FROMSELECT X.EmployeeID, X.EmployeeName FROM LASRLIB.MyTable X" error.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;What is the correct syntax for using hard coded values in this scenario?&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 19:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Trying-to-insert-hard-code-row-into-table-in-data-prep/m-p/533692#M11864</guid>
      <dc:creator>VAinTestMode</dc:creator>
      <dc:date>2019-02-07T19:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to insert hard-code row into table in data prep</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Trying-to-insert-hard-code-row-into-table-in-data-prep/m-p/533880#M11867</link>
      <description>&lt;P&gt;As I can recall, SELECT requires a FROM clause.&lt;/P&gt;
&lt;P&gt;So you might need to refer to a row stored in an existing table, rather than hard code the values.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 10:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Trying-to-insert-hard-code-row-into-table-in-data-prep/m-p/533880#M11867</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2019-02-08T10:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to insert hard-code row into table in data prep</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Trying-to-insert-hard-code-row-into-table-in-data-prep/m-p/534003#M11869</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up referencing the table and then just capping the select statement to a single row to avoid multiple entries going into the table:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SELECT
   X.EmployeeID,
   X.EmployeeName
FROM
   LASRLIB.MyTable X

UNION

SELECT
   0,
   'EMPTY ROW'
FROM
   LASRLIB.MyTable X (obs=1)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;WORKED!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 16:40:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Trying-to-insert-hard-code-row-into-table-in-data-prep/m-p/534003#M11869</guid>
      <dc:creator>VAinTestMode</dc:creator>
      <dc:date>2019-02-08T16:40:03Z</dc:date>
    </item>
  </channel>
</rss>

