🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 05-31-2019 10:16 AM
(10297 views)
Hi,
I'm fairly new to SAS and was wondering if I can have multiple "queries"/sql statements in proc sql. Or maybe I just don't know the primary use of proc sql.
Basically, I wanted to know if I need to create multiple proc sqls or do all sql statements in proc sql. For example, can I have any number of combination of create table/select statements inside one proc sql?
Thanks.
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you can have multiple queries in one SQL Procedure
proc sql;
create table class1 as
select * from sashelp.class;
create table class2 as
select * from sashelp.class;
quit;
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can certainly have multiple queries in one PROC SQL
proc sql;
create table a as select * from sashelp.class where age=14;
create table b as select make,model,type,origin from sashelp.cars where
mspr>40000 and horsepower>200;
quit;
--
Paige Miller
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you can have multiple queries in one SQL Procedure
proc sql;
create table class1 as
select * from sashelp.class;
create table class2 as
select * from sashelp.class;
quit;