Hi ,
Could you please help me to fix this code ? I didn't understand which is the issue.
I have a Teradata table IRM.Exploitrigger with 2 columns (ID,maxexploit_dt).
I just would like to add a new row with new information on this table.
Many thanks in advance.
/* code*/
proc sql;
connect to teradata
(user=&td_usr. password=&td_pass. server = 'edwprod' database = 'insights_consumer' mode = teradata);
EXECUTE (
CREATE MULTISET VOLATILE TABLE basedate AS
(
select
1 as ID,
max(month_end_dt) as maxexploit_dt
from profitability_sandbox.exploitation_layer_pm
) WITH DATA PRIMARY INDEX(ID) ON COMMIT PRESERVE ROWS) BY TERADATA;
Execute
(
proc sql;
insert into
IRM.Exploitrigger (ID,maxexploit_dt)
( select ID,
maxexploit_dt from basedate)
);
quit;
/* log*/
proc sql;
26 !
27 connect to teradata
28 (user=&td_usr. password=&td_pass. server = 'edwprod' database = 'insights_consumer' mode = teradata);
28 !
29 EXECUTE (
30 CREATE MULTISET VOLATILE TABLE basedate AS
31 (
32 select
33 1 as ID,
34 max(month_end_dt) as maxexploit_dt
35
36 from profitability_sandbox.exploitation_layer_pm
37
38 ) WITH DATA PRIMARY INDEX(ID) ON COMMIT PRESERVE ROWS) BY TERADATA;
39 Execute
40 (
41 proc sql;
42 insert into
43 IRM.Exploitrigger (ID,maxexploit_dt)
44 ( select ID,
45 maxexploit_dt from basedate)
46 );
_
22
ERROR 22-322: Expecting a name.
1. Execute by xxx () contains native teradata SQL between the parentheses.
proc sql; should be removed.
2. Execute must be used with BY.
3. A closing parenthesis is missing.
1. Execute by xxx () contains native teradata SQL between the parentheses.
proc sql; should be removed.
2. Execute must be used with BY.
3. A closing parenthesis is missing.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.