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

Hello

I have a query tat someone wrote and run it on teradata.

My task is to run this query in SAS.

Please find the general form of the query that was run on teradata

/***Query that was run on teradata**/
CREATE VOLATILE TABLE  ttt  AS (
SELECT
FROM  
WHERE		
  )
WITH DATA  PRIMARY INDEX (Branch_Cust_IP) ON COMMIT PRESERVE ROWS;

I have tried to convert the query to sas environment and run it in SAS.

Please see the general form of the query that I run in sas

proc sql;
create table ttt  (index=(Branch_Cust_IP/unique)) AS
SELECT
FROM 
where    
;
quit;

I get an error

ERROR: Duplicate values not allowed on index Branch_Cust_IP for file ttt.
NOTE: Compressing data set WORK.ttt decreased size by 40.21 percent. 
      Compressed is 127453 pages; un-compressed would require 213157 pages.
ERROR: Index creation failed for one or more indexes.

My question- How can I solve the problem. Please note that in teradata it is running well.

Please also note that my connection from sas to teradata base is done by adding TeraData. before the table name (The admin person created this connection between sas and tera so in this issue it is working well)

1 ACCEPTED SOLUTION

Accepted Solutions
Ronein
Onyx | Level 15

I found the solution

Need to write

create table ttt  (index=(Branch_Cust_IP)) AS

instead of 

create table ttt  (index=(Branch_Cust_IP/unique)) AS

View solution in original post

1 REPLY 1
Ronein
Onyx | Level 15

I found the solution

Need to write

create table ttt  (index=(Branch_Cust_IP)) AS

instead of 

create table ttt  (index=(Branch_Cust_IP/unique)) AS

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 575 views
  • 0 likes
  • 1 in conversation