BookmarkSubscribeRSS Feed
KrishnaChandra
Calcite | Level 5

HI all

   how can i create a table in access by using proc sql. I also write code to do the same activity but i couldn't make the necessary result.

  Here i put ma code on below.If anyone help me to do the task

proc sql;

connect to access(path='C:\Users\Krishna\Desktop\sass\three.mdb');

execute(create table kc (id number,name text,depid number)by access;

execute(insert into kc values(1,'abcd',101)) by access;

execute(insert into kc values(2,'jack',102)) by access;

execute(insert into kc values(2,'kilby',103)) by access;

disconnect from access;

quit;

Thanking you

Krishnachandran

4 REPLIES 4
LinusH
Tourmaline | Level 20

So what is the result? DO you get any errors, or does your table not look as you expect?

I assume that the three.mdb already exists.

Are you doing this for testing/educational purposes? Inserting data in Access via SAS using hard coded insert values isn't best practice...

Data never sleeps
KrishnaChandra
Calcite | Level 5

Hai Linush am beginner in sas.

The question was about for my learning purpose .Here the three.mdb already exist and the file also contain a table Krish.My need is to add new table in three.mdb with the name kc.I saw the same code in log window while i run the code .I couldn't saw any error messages.

LinusH
Tourmaline | Level 20

If you don't see any messages at all, you probably haven't fixed the parenthesis problem.

You should see a

NOTE: PROCEDURE SQL used...

after you submitted your code.

Data never sleeps
LinusH
Tourmaline | Level 20

You are missing a right parenthesis in your create table code line.

Once there it works for me. I use MS Access 2013 on SAS 9.4.

Data never sleeps

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 871 views
  • 0 likes
  • 2 in conversation