Hi,
I am newbie for SAS EG, May I need you guy help me about issue,
I would like to create the table with specific the data type, then insert the data as select from once table use PROC SQL with Neteza DB,
The result create table is working but NOT any data insert to that new table as I have created, my code as below,
PROC SQL;
CONNECT TO NETEZZA AS CON1(DATABASE=SAS_ADM SERVER="192.168.00.00" AUTHDOMAIN= "ABC");
EXECUTE(
CREATE TABLE SAS_ADM..TK_TEMP3
(
Center NATIONAL CHARACTER VARYING(10),
FoundSentence NATIONAL CHARACTER VARYING(255)
);
INSERT INTO SAS_ADM..TK_TEMP3
SELECT Center,
FoundSentence
FROM WORK.FILE_TK;
) BY CON1;
DISCONNECT FROM CON1;
QUIT;
The method in SAS is pretty simple:
libname netezza netezza noprompt="<put your connection string here>";
proc datasets library = netezza;
append base = netezza.MyTable data = work.MySASTable;
run;
quit;
If you want a Netezza-only solution then I suggest you use a Netezza forum.
Please note that a single dot is used to separate library from dataset. And if you want to load data from Netezza, why do have "from work.file_tk" in your sql-statement?
I have import the csv file and store in WORK library, for move to Neteza libray in next step.
I have change to single dot in my statement but result still same, NOT any data have insert to new table.
You are passing an SQL query directly to Netezza to process - it knows nothing about SAS WORK datasets. You have to move the SAS dataset to Netezza before loading it.
A better way to load the data would be to create a Netezza connection with a LIBNAME statement and then use PROC DATASETS with an APPEND statement to insert the SAS rows into the Netezza table.
Would a better process not be to import the CSV directly into Netezza? Having an intermediary stage of loading to one software just to pass to another is adding an unnecessary layer of complexity and potential issues.
The method in SAS is pretty simple:
libname netezza netezza noprompt="<put your connection string here>";
proc datasets library = netezza;
append base = netezza.MyTable data = work.MySASTable;
run;
quit;
If you want a Netezza-only solution then I suggest you use a Netezza forum.
I follow this suggestion, it working!!
This is solution
I'am user in my company, I have limitation access to environment Netteza and i know this solution to prepare CSV data into Netteza first and read completed table via SAS EG, that why I import the CSV file via SAS EG only. maybe I will try to talk with person who responsibility with Netteza for import this CSV file.
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!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.