Try
data work.a;
set DB.existingdata;
run;
Then see what happens. If this works your libname works, else you have issue with libname, you need to contact someone in your team to ask what they use and fix it
data db.a;
set work.a(obs=1);
run;
if above step does not work but your first step has worked then you have only read access to mysql table, but you do not write access. Which means you need to contact your database admin about this.
Good point!
I tried and failed at the 1st step, when I used the code below, there was no error reported so I thought the libname and connection should be OK.
libname DB mysql user = userid password = mypassword schema=dbschema server="thisistheserver.com" port = 3311;
It seems do have some problems...
Here is the SAS code I used to pull data from DB.existingdata and it do work, please help me on how to upload data if possible,
proc sql;
connect to mysql (server="thisistheserver.com" port=3311 user=userid password=mypassword);
create table want as select * from connection to mysql
(
select *
from dbschema.existingdata
);
disconnect from mysql;
quit;
As someone mentioned before there is no SCHEMA= option mentioned in the documentation for SAS/Access to MYSQL.
There is a DATABASE= option.
Looks like you should be using that option instead.
libname DB mysql
user = userid password = mypassword
server="thisistheserver.com" port = 3311
database=dbschema
;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.