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

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
Meteorite | Level 14

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
Meteorite | Level 14

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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 176 views
  • 0 likes
  • 1 in conversation