LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 23 Jan 2008 10:30:39 -0500
Reply-To:     Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:      Re: Check the existence of librairy

does that mean, you simply don't want to execute if a library is not present?

What you could do:

%macro doit; /* so u can use macro logic */

%let name1=%str(C:\documents\doc1); %let name2=....;

%do i=1 %to 9; /* or what you want */ %let rc=%sysfunc(libname(tab&i,&&name&i)); %if &rc=0 then %do; data tab&i..xy; ... %end; %end; %mend; %doit;

If you want some names to be "missing", don't use %str() or %str(.). Use at least ... -three dots or something like EMPTY - what doesn't exist. Gerhard

On Wed, 23 Jan 2008 06:59:46 -0800, ash007 <RamsamyAshley@GMAIL.COM> wrote:

>hello, i have a sas programm and i want it execute well even there are >some librayries which don't exist. > >tab3 tab4 n tab5 don't exist. > >libname tab1 'D:\Documents\S087164\Mes Documents\SAS'; >DATA TAB1.BIDON; INPUT X1 X2 Y1 Y2 X5; CARDS; >1 5 5 1161 1 >35 6 3 1336 1 >82 1 5 1499 77 >;RUN; > >libname tab2 'D:\Documents\S087164\Mes Documents\SAS'; >DATA TAB2.BIDON; INPUT X1 X2 Y1 Y2 X5; CARDS; >1 5 5 1161 1 >35 6 3 1336 75645 >82 1 5 1499 1 >;RUN; > >/*=================================================*/ > >DATA FUSION; >SET >TAB1.BIDON (KEEP = X1 X2 X5 WHERE = (X5 = 1)) >TAB2.BIDON (KEEP = X1 X2 X5 WHERE = (X5 = 1)) >tab3.BIDON (KEEP = X1 X2 X5 WHERE = (X5 = 1)) >tab4.BIDON (KEEP = X1 X2 X5 WHERE = (X5 = 1)) >tab5.BIDON (KEEP = X1 X2 X5 WHERE = (X5 = 1)) >; >RUN; > >thank for helping me. > >ash007


Back to: Top of message | Previous page | Main SAS-L page