set question

  • Follow


hi everyone,

here is my problem.

I have several datasets having the same name's beginning. In my case,
it's final_app.
As those data sets have been created with loops, their name are :
final_app11
final_app12
final_app21
etc
etc
etc.

And i need to concatenate all those tables in one.

i tried with a double loop and final_app&i&j but it doesn't seem to
work.

Someone would have an idea ?

Vince

0
Reply kid20100 (13) 8/16/2007 12:54:54 PM

Proc SQL ;
Select MemName Into : DSNList Separated By ' '
From Dictionary.Tables
  Where LibName = '<Your Library Name All Upper Case>'
    And MemName Like 'FINAL_APP%' ;
Quit ;


Data Need ;
Set &DSNList ;
Run ;


Toby Dunn


Two wrongs are only the beginning.

Success always occurs in private and failure in full view.

Experience is something you don't get until just after you need it.





From: vince dubois <kid20100@GMAIL.COM>
Reply-To: vince dubois <kid20100@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: set question
Date: Thu, 16 Aug 2007 05:54:54 -0700

hi everyone,

here is my problem.

I have several datasets having the same name's beginning. In my case,
it's final_app.
As those data sets have been created with loops, their name are :
final_app11
final_app12
final_app21
etc
etc
etc.

And i need to concatenate all those tables in one.

i tried with a double loop and final_app&i&j but it doesn't seem to
work.

Someone would have an idea ?

Vince

_________________________________________________________________
A new home for Mom, no cleanup required. All starts here.
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
0
Reply tobydunn (6070) 8/16/2007 2:07:29 PM


Hi Vince,

Here's another approach.  But I personally prefer Toby's.

Florio

data final_app11;
x = 11;
data final_app12;
x= 12;
data final_app21;
x = 21;
run;
data final_app22;
x = 22;
run;
%macro test;
%do i = 1 %to 2;
 %do j = 1 %to 2;
  proc append base = all data = final_app&i&j;
  run;
 %end;
%end;
%mend test;
%test;






On Thu, 16 Aug 2007 14:07:29 +0000, toby dunn <tobydunn@HOTMAIL.COM> wrote:

>Proc SQL ;
>Select MemName Into : DSNList Separated By ' '
>From Dictionary.Tables
>  Where LibName = '<Your Library Name All Upper Case>'
>    And MemName Like 'FINAL_APP%' ;
>Quit ;
>
>
>Data Need ;
>Set &DSNList ;
>Run ;
>
>
>Toby Dunn
>
>
>Two wrongs are only the beginning.
>
>Success always occurs in private and failure in full view.
>
>Experience is something you don't get until just after you need it.
>
>
>
>
>
>From: vince dubois <kid20100@GMAIL.COM>
>Reply-To: vince dubois <kid20100@GMAIL.COM>
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: set question
>Date: Thu, 16 Aug 2007 05:54:54 -0700
>
>hi everyone,
>
>here is my problem.
>
>I have several datasets having the same name's beginning. In my case,
>it's final_app.
>As those data sets have been created with loops, their name are :
>final_app11
>final_app12
>final_app21
>etc
>etc
>etc.
>
>And i need to concatenate all those tables in one.
>
>i tried with a double loop and final_app&i&j but it doesn't seem to
>work.
>
>Someone would have an idea ?
>
>Vince
>
>_________________________________________________________________
>A new home for Mom, no cleanup required. All starts here.
>http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
0
Reply foa2 (105) 8/16/2007 2:23:04 PM

Use dictionary.tables to output all the members with that pattern, and
insert into macrovar
Example 6 SQL help
then look at the select INTO operator under the same

I use this a lot as I do not know how many datasets I am dealing with

(an old SAS programmer forcing myself to use proc sql!)


On Aug 16, 1:54 pm, vince dubois <kid20...@gmail.com> wrote:
> hi everyone,
>
> here is my problem.
>
> I have several datasets having the same name's beginning. In my case,
> it's final_app.
> As those data sets have been created with loops, their name are :
> final_app11
> final_app12
> final_app21
> etc
> etc
> etc.
>
> And i need to concatenate all those tables in one.
>
> i tried with a double loop and final_app&i&j but it doesn't seem to
> work.
>
> Someone would have an idea ?
>
> Vince


0
Reply jontugman (18) 8/16/2007 3:06:17 PM

THAKS FOR YOUR HELP!

0
Reply kid20100 (13) 8/17/2007 12:13:03 PM

4 Replies
31 Views

(page loaded in 4.176 seconds)

Similiar Articles:













7/2/2012 3:03:31 AM


Reply: