BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jorquec
Quartz | Level 8

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 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

 

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.

View solution in original post

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

 

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.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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