|Date: ||Wed, 8 Dec 1999 14:53:04 -0500|
|Reply-To: ||"Wang, Zhaoping (PCM - NJ)" <ZWang@NA2.US.ML.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||"Wang, Zhaoping (PCM - NJ)" <ZWang@NA2.US.ML.COM>|
|Subject: ||A SAS Problem|
Since I'm not on the list, please send your solution
privately to my
The following code is used to create a SAS dataset/table from
connect to db2 (database=dbgood user= using= );
create table sys.one as
select * from
connection to db2
disconnect from db2;
Note that the middle portion of the code is not SAS but standard
SQL recognizable by
DB2. You can insert "where" clause in that portion to pull a
part of table1 on DB2
and to create a smaller SAS data set.
Suppose you have an id list that is too long to be typed so you
cannot use "where"
clause. You would necessarily think of the following solution:
proc format cntlin=namelist;
where id=start, label='OK', and fmtname='$namex'
and then try
if put (id, $namex.) = 'OK'
But how to fill this subsetting into the standard portion of
the above SQL code stream ?
Also assume that table1 on DB2 is huge, so it's not possible to
create a new table
that contains the same number of obs as table1 (and then try
subsetting on your own
Thanks for your help.