<?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 From statement error in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/From-statement-error/m-p/815833#M34259</link>
    <description>&lt;P&gt;I am trying to get a data from the previous table using from statement but getting error. Please suggest experts.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql;
create table Test AS
Select
Account_code
From work.'foreign address'n;
quit;


proc sql;
create table Add_repcode as 
select a.*,
b.rep_code,
From Test
inner join p2scflow.debt as b on a.Account_code= b.Account_code;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Getting this error

30         proc sql;
31         create table Add_repcode as
32         select a.*,
33         b.rep_code,
34         From Test
                _________________
                79
ERROR 79-322: Expecting a FROM.

35         inner join p2scflow.debt as b on a.account_code = b.account_code ;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
36         quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 31 May 2022 14:17:09 GMT</pubDate>
    <dc:creator>Sandeep77</dc:creator>
    <dc:date>2022-05-31T14:17:09Z</dc:date>
    <item>
      <title>From statement error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/From-statement-error/m-p/815833#M34259</link>
      <description>&lt;P&gt;I am trying to get a data from the previous table using from statement but getting error. Please suggest experts.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql;
create table Test AS
Select
Account_code
From work.'foreign address'n;
quit;


proc sql;
create table Add_repcode as 
select a.*,
b.rep_code,
From Test
inner join p2scflow.debt as b on a.Account_code= b.Account_code;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Getting this error

30         proc sql;
31         create table Add_repcode as
32         select a.*,
33         b.rep_code,
34         From Test
                _________________
                79
ERROR 79-322: Expecting a FROM.

35         inner join p2scflow.debt as b on a.account_code = b.account_code ;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
36         quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 May 2022 14:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/From-statement-error/m-p/815833#M34259</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2022-05-31T14:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: From statement error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/From-statement-error/m-p/815838#M34260</link>
      <description>&lt;P&gt;You have an extra comma.&lt;/P&gt;
&lt;P&gt;Make sure that you define the aliases if you are going to use them to reference variables from specific input dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not hide continuation characters at the END of the line.&amp;nbsp; Place them at the BEGINNING of the line.&amp;nbsp; It is much easier for humans to scan for them there.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table Add_repcode as 
  select a.*
       , b.rep_code
  from Test as a
   inner join p2scflow.debt as b
    on a.Account_code= b.Account_code
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 14:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/From-statement-error/m-p/815838#M34260</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-05-31T14:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: From statement error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/From-statement-error/m-p/815842#M34261</link>
      <description>&lt;P&gt;What&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;points out is the comma at the end of line 4 (see my comment) is the cause of your error. Delete that comma and problem solved&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table Add_repcode as 
select a.*,
b.rep_code, /* This comma at the end of this line is the issue */
From Test
inner join p2scflow.debt as b on a.Account_code= b.Account_code;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 May 2022 14:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/From-statement-error/m-p/815842#M34261</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-05-31T14:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: From statement error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/From-statement-error/m-p/815850#M34262</link>
      <description>&lt;P&gt;I did tried doing that but it gave me unresolved reference and few more errors.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;9         proc sql;
30         create table Add_repcode as
31         select a.*,
32         b.rep_code
33         From Test
34         inner join p2scflow.debt as b on a.account_code = b.account_code ;
ERROR: Unresolved reference to table/correlation name a.
ERROR: Could not expand a.*, correlation name not found.
ERROR: The following columns were not found in the contributing tables: a.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
35         quit;
NOTE: The SAS System stopped processing this step because of errors.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 May 2022 14:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/From-statement-error/m-p/815850#M34262</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2022-05-31T14:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: From statement error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/From-statement-error/m-p/815857#M34263</link>
      <description>&lt;P&gt;Because you have additional errors that become prominent once the comma is removed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ERROR: Unresolved reference to table/correlation name a.&lt;/PRE&gt;
&lt;P&gt;You don't have a table referred to with the alias A. So you can't use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select a.*,&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe the fix is obvious, so I leave it as a homework assignment for you.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 15:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/From-statement-error/m-p/815857#M34263</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-31T15:18:13Z</dc:date>
    </item>
  </channel>
</rss>

