DATA Step, Macro, Functions and more

Apparent symbolic reference not resolved.

Reply
N/A
Posts: 0

Apparent symbolic reference not resolved.

This is the log of mmy code which does not give an error but still if I try to reference the value n_lcg I get an error that the value cannot be resolved.
How do I resove this error?


213 PROC SQL STIMER noprint;
NOTE: SQL Statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

214 CONNECT TO &tera;
NOTE: SQL Statement used (Total process time):
real time 0.38 seconds
cpu time 0.02 seconds

215 create table cnt_lcg as
216 select * from CONNECTION TO teradata
217 (select count(*) as cnt from user_wrk.sa_lgc );
NOTE: Table WORK.CNT_LCG created, with 1 rows and 1 columns.

NOTE: SQL Statement used (Total process time):
real time 19.53 seconds
cpu time 0.00 seconds

218
235 select cnt into :n_lcg from cnt_lcg;
NOTE: SQL Statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

245 disconnect from teradata;
NOTE: SQL Statement used (Total process time):
real time 0.07 seconds
cpu time 0.01 seconds

246 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds


%macro check_n;
108 /*%if %eval(&n_lcg) = 0 %then %do;
109 %let err=No Records in sa_lgc;
110 %job_log(id=&job_id,job_nm=JOB1,remark=&err,m_id=WAP,stat=Complete);
111
112 %put endsas1;
113 %end;*/

WARNING: Apparent symbolic reference N_lcg not resolved.

Thank you!
Valued Guide
Posts: 634

Re: Apparent symbolic reference not resolved.

Posted in reply to deleted_user
We are not seeing all of your program. Specifically you have not shown us the full definition of the macro CHECK_N (which currently has all the shown code commented out). Nor do we see where or how the macro variable N_LCG is called.

Consider using a %PUT N_LCG &N_LCG; statement to verify that the macro variable exists and has a value.
SAS Employee
Posts: 58

Re: Apparent symbolic reference not resolved.

Posted in reply to deleted_user
My guess is that this is a "timing" thing. The warning is likely coming during the compilation of the %check_n macro which occurs before execution time (when your PROC SQL runs).
Ask a Question
Discussion stats
  • 2 replies
  • 381 views
  • 0 likes
  • 3 in conversation