All
Any idea? I thought it’s assigning a macro globally but 2nd step is working so its not a global macro issue.
The macro variable &wt05_count does not exist. Then, somewhere along the way, the macro variable &wt05_count is created and you don't get the WARNING. When you create a new job, it doesn't know about the macro variables from other jobs. Other than that, we can't say as you have shown us only a small portion of the program.
Thanks,
This is a simple user witten code in the user written transofrm . I tested once again and it looks like an issue if add a sub job(job in a job) if I add a sub job to a job then it is not working. If I remove the subjob then it is working.
nothing to do with subjob but not sure why macro is not resolving.
proc sql;
connect to teradata ( user=myusr1 password=mypwd1 );
select * from connection to teradata
(select count(*) as count into:wt05_count from test)
;
disconnect from teradata;
quit;
%put &wt05_count
If the wt05_count macro variable has been deleted in the subjob, or
if the wt05_count macro variable has been created in the subjob, then
it has become a local macro variable.
If it's the former, check the symdel and %symdel statements, and if it's the latter, try putting
%global wt05_count;
in front of the proc sql.
symdel deletes a macro variable.
Try searching for "symdel" in subjob.
If you find it, make sure you haven't deleted wt05_count.
That code looks wrong. It looks like you are trying to create a variable in Teradata instead of a macro variable in SAS.
Also when using INTO clause of PROC SQL to make a macro variable it is best to first set some default value for the macro variable in case the query returns no observations.
proc sql noprint;
connect to teradata ( user=myusr1 password=mypwd1 );
%let wt05_count=QUERY FAILURE;
select count into :wt05_count from connection to teradata
(select count(*) as count from test)
;
disconnect from teradata;
quit;
%put &wt05_count
also Just tried with simple proc sql and it didn't work.
libname test teradata AUTHDOMAIN="TeradataAuth" database=test fastload=yes;
proc sql noprint ;
select count(*) as count into:wt05_count from test.test;
quit;
I added a dummy job and run the code worked fine. If I add this subjob and Getting the warning. I think, the problem is with subjob.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.