<?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: help in proc sql statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356376#M83568</link>
    <description>&lt;P&gt;And what exactly happens when you run&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table _c01_ as
select dequote(scan(orion,-3,".")) as a.sid, dequote(scan(orion,-2,".")) as a.mame,
dequote(scan(orion,-1,".")) as a.name, a.oriion,a.ORION
from sv a left join _libmes_ b
on a.sid=b.sid and a.mame=b.mame;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;Don't force us to pry information out of your nose.&lt;/P&gt;</description>
    <pubDate>Fri, 05 May 2017 13:31:45 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-05-05T13:31:45Z</dc:date>
    <item>
      <title>help in proc sql statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356354#M83562</link>
      <description>&lt;P&gt;i am extracting a part from the variables in sv dataset in order to merge with _libmes_ dataset which are common but i am not able use the below condition.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anyone help if the below code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table _c01_ as&lt;BR /&gt;select dequote(scan(orion,-3,".")) as a.sid, dequote(scan(orion,-2,".")) as a.mame,&lt;BR /&gt;dequote(scan(orion,-1,".")) as a.name, a.oriion,a.ORION&lt;BR /&gt;from sv a left join _libmes_ b&lt;BR /&gt;on a.sid=b.sid and a.&lt;SPAN&gt;mame&lt;/SPAN&gt;=b.&lt;SPAN&gt;mame&lt;/SPAN&gt;;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 13:02:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356354#M83562</guid>
      <dc:creator>alexdsa310</dc:creator>
      <dc:date>2017-05-05T13:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: help in proc sql statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356359#M83564</link>
      <description>&lt;P&gt;And why is that?&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 13:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356359#M83564</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-05-05T13:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: help in proc sql statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356360#M83565</link>
      <description>&lt;P&gt;Sorry, so what is it that "&lt;SPAN&gt;not able use the below condition." isnt working? &amp;nbsp;Refer to the guidance under the Post button when you make a post - post test data in the form of a datastep, what the output should look like, what code you have and log with errors/warnings, and a brief explanation.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 13:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356360#M83565</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-05T13:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: help in proc sql statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356362#M83566</link>
      <description>&lt;P&gt;You should know by now (29 posts on communities.sas.com) that you need to be more precise in formulating your question. If an ERROR or WARNING happens, posting the log is an &lt;U&gt;absolute must&lt;/U&gt;!&lt;/P&gt;
&lt;P&gt;If a semantic problem exists (result does not match expectations), give a thorough description of that. If in doubt, post example data (datastep!).&lt;/P&gt;
&lt;P&gt;"I have a problem" or "does not work" is totally useless.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 13:18:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356362#M83566</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-05T13:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: help in proc sql statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356371#M83567</link>
      <description>&lt;P&gt;sorry for not being clear. i am using the below code and it works just thought if it can fit in a single sql table. If not i can use the below.&lt;/P&gt;&lt;P&gt;Will provide sample data if this is not clear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _c0_;&lt;BR /&gt;set sv;&lt;BR /&gt;sid=dequote(scan(origin,-3,"."));&lt;BR /&gt;mme=dequote(scan(orion,-2,"."));&lt;BR /&gt;nme=dequote(scan(orion,-1,"."));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table _c01_ as&lt;BR /&gt;select a.*,b.lime from _c0_ a left join _limes_ b&lt;BR /&gt;on a.sid=b.sid ;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 13:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356371#M83567</guid>
      <dc:creator>alexdsa310</dc:creator>
      <dc:date>2017-05-05T13:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: help in proc sql statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356376#M83568</link>
      <description>&lt;P&gt;And what exactly happens when you run&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table _c01_ as
select dequote(scan(orion,-3,".")) as a.sid, dequote(scan(orion,-2,".")) as a.mame,
dequote(scan(orion,-1,".")) as a.name, a.oriion,a.ORION
from sv a left join _libmes_ b
on a.sid=b.sid and a.mame=b.mame;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;Don't force us to pry information out of your nose.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 13:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356376#M83568</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-05T13:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: help in proc sql statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356378#M83569</link>
      <description>&lt;P&gt;sorry once again. i posted the error message but somehow it didnt make it.&lt;/P&gt;&lt;P&gt;this error comes in &amp;nbsp;a. part&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;as a&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;sid&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, ',', AS, FORMAT,&lt;BR /&gt;FROM, INFORMAT, INTO, LABEL, LEN, LENGTH, TRANSCODE.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 13:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356378#M83569</guid>
      <dc:creator>alexdsa310</dc:creator>
      <dc:date>2017-05-05T13:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: help in proc sql statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356380#M83570</link>
      <description>&lt;P&gt;You can't use table aliases in the "as" part of the select; you are declaring a new name there, and that belongs to the output table, where no table designator is needed and is therefore not allowed.&lt;/P&gt;
&lt;P&gt;Use&lt;/P&gt;
&lt;PRE&gt;as sid&lt;/PRE&gt;
&lt;P&gt;instead.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 13:38:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356380#M83570</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-05T13:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: help in proc sql statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356381#M83571</link>
      <description>&lt;P&gt;I hadn't spotted this at first glance - good example for good code formatting.&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table _C01_ as
  select  dequote(scan(ORION,-3,".")) as A.SID, 
          dequote(scan(ORION,-2,".")) as A.MAME,
          dequote(scan(ORION,-1,".")) as A.NAME, 
          A.ORIION,
          A.ORION
  from    SV A 
  left join _LIBMES_ B
  on      A.SID=B.SID 
  and     A.MAME=B.MAME;
quit;&lt;/PRE&gt;
&lt;P&gt;In the select statement you are selecting variables as &amp;lt;alis&amp;gt;.&amp;lt;variable&amp;gt; as select is creating the new variable, it can't have an alias. &amp;nbsp;Remove the A. from each of these. &amp;nbsp;Then if it still doesn't work, post full code and full log.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 13:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356381#M83571</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-05T13:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: help in proc sql statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356384#M83572</link>
      <description>&lt;P&gt;Once again this underlines the importance of Maxim 12, and the dreadful consequences of spaghetti coding.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 13:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-in-proc-sql-statement/m-p/356384#M83572</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-05T13:42:43Z</dc:date>
    </item>
  </channel>
</rss>

