Hello:
How to generate a SAS file after proc sql? Thanks.
proc sql;
select score from test1
intersect all
select score from test2;
quit;
Precede the SELECT clause with a CREATE TABLE clause:
proc sql;
create table mytable as
select score from test1
intersect all
select score from test2;
quit;
Precede the SELECT clause with a CREATE TABLE clause:
proc sql;
create table mytable as
select score from test1
intersect all
select score from test2;
quit;
The documentation is pretty good for SQL - see the section titled 'Creating Tables'
https://support.sas.com/documentation/cdl/en/sqlproc/69822/HTML/default/viewer.htm#titlepage.htm
My SAS version is 9.3, not 9.4
@ybz12003 wrote:
My SAS version is 9.3, not 9.4
It won't hurt to look at basics of SQL documentation. The basic elements such as Create Table , Select, From, Group By and where clauses haven't changed drastically since SAS 6.8. There may be as few additional features here and there but just as the data step, except for adding new functions, changes slowly so does the base SQL definition.
And if you hunt around you will find the version 9.3 documentation on the SAS support website as well.
I would also ask why the online help was not installed with your installation. Does the F1 key bring up anything for SAS?
@ybz12003 wrote:
My SAS version is 9.3, not 9.4
It really doesn't matter for this topic, the major difference is with FEDSQL and MEDIAN function, neither of which you appear to be using. And you can find the same section in the 9.3 documentation, if you choose to look.
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!
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.