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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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