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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.