BookmarkSubscribeRSS Feed
Sandeep77
Lapis Lazuli | Level 10

Hi Experts,

What is incorrect in the code? Can you please have a look and let me know my mistake?

proc sql;
create table RPC as 
select a.*,

count(distinct(b.debt_code)) as RPC,
Count(b.debt_code) as RPCs 
from  P2SCFLOW.debt_trans as b 
inner join COLL.TransCodeLookup as b on ( b.tran_Code = c.trancode ) 
right join work.confirmed_email as a 
on (a.Account_number = b.debt_code);

quit; 

Error Log:

                                                          The SAS System                             11:41 Monday, October 10, 2022

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Dialled numbers';
4          %LET _CLIENTPROCESSFLOWNAME='Process Flow';
5          %LET _CLIENTPROJECTPATH='S:\Trace\Trace Integrity Analyst Data\Projects and Tasks\3. Sandeep\Dialler\Dialler V1.egp';
6          %LET _CLIENTPROJECTPATHHOST='LWLT5CG9322XFL';
7          %LET _CLIENTPROJECTNAME='Dialler V1.egp';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=SVG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         %macro HTML5AccessibleGraphSupported;
15             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 %then ACCESSIBLE_GRAPH;
16         %mend;
17         ODS LISTING GPATH=&sasworklocation;
18         FILENAME EGHTML TEMP;
19         ODS HTML5(ID=EGHTML) FILE=EGHTML
20             OPTIONS(BITMAP_MODE='INLINE')
21             %HTML5AccessibleGraphSupported
22             ENCODING='utf-8'
23             STYLE=HTMLBlue
24             NOGTITLE
25             NOGFOOTNOTE
26             GPATH=&sasworklocation
27         ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
28         


29         proc sql;
30         create table RPC as
31         select a.*,
32         
33         count(distinct(b.debt_code)) as RPC,
34         Count(b.debt_code) as RPCs
35         from  P2SCFLOW.debt_trans as b
36         inner join COLL.TransCodeLookup as b on ( b.tran_Code = c.trancode )
37         right join work.confirmed_email as a
38         on (a.Account_number = b.debt_code);
ERROR: Unresolved reference to table/correlation name c.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
39         
40         quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.15 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              6231.12k
      OS Memory           30556.00k
      Timestamp           10/10/2022 03:59:28 PM
      Step Count                        30  Switch Count  26
      
41         
42         %LET _CLIENTTASKLABEL=;
43         %LET _CLIENTPROCESSFLOWNAME=;
2                                                          The SAS System                             11:41 Monday, October 10, 2022

44         %LET _CLIENTPROJECTPATH=;
45         %LET _CLIENTPROJECTPATHHOST=;
46         %LET _CLIENTPROJECTNAME=;
47         %LET _SASPROGRAMFILE=;
48         %LET _SASPROGRAMFILEHOST=;
49         
50         ;*';*";*/;quit;run;
51         ODS _ALL_ CLOSE;
52         
53         
54         QUIT; RUN;
55         
1 REPLY 1
Quentin
Super User

Your code mentions a table aliased as c:

inner join COLL.TransCodeLookup as b on ( b.tran_Code = c.trancode )   /*** c.trancode does not exist! ***/

But there is no table / alias "c".

 

Perhaps you meant:

inner join COLL.TransCodeLookup as c on ( b.tran_Code = c.trancode )
The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 607 views
  • 0 likes
  • 2 in conversation