Write and run SAS programs in your web browser

how to create two tables from select query?

Reply
Contributor
Posts: 30

how to create two tables from select query?

Hi

Below code I am creating two tables as a output of select query.macro parametere aa have 2 values so create 2 tables.I want to name the table from that.ANy idea how to do that

%macro dismon(aa);
proc sql;
select DISTINCT MONTH from raw102.&aa;
quit;    
%mend;

data test;
set sashelp.vcolumn;
where libname="RAW102" and name="MONTH";
call execute('%dismon(' || memname || ');');
keep memname;
run;

Grand Advisor
Posts: 16,413

Re: how to create two tables from select query?

Contributor
Posts: 30

Re: how to create two tables from select query?

create table will create 1 table.I want 2 tables as output of select query result in 2 table

Contributor
Posts: 30

Re: how to create two tables from select query?

create table data1 as select query

this create only one table

i want create table data1 data2 as select query

but its not allowed any other way of doing it

Grand Advisor
Posts: 16,413

Re: how to create two tables from select query?

Search : split data into subsets. 

 

Either here or Google. 

There is a writeup on sascommunity.org and SAS Dummy blog. 

There are at least a dozen solutions here, more like at least one a week. 

Contributor
Posts: 30

Re: how to create two tables from select query?

thank you.will check

Post a Question
Discussion Stats
  • 5 replies
  • 85 views
  • 0 likes
  • 2 in conversation