|
Chris:
Try the following code (I added DIRREF and It worked for me !)
%macro test;
%let rc=%sysfunc(filename(mydir,'c:\950212',dirref));
%put &rc;
%if &rc ne 0 %then %put "Great, just what I expected";
%else %put "This is wrong";
%mend;
%test;
Log:
1
2
3 %macro test;
4 %let rc=%sysfunc(filename(mydir,'c:\950212',dirref));
5 %put &rc;
6 %if &rc ne 0 %then %put "Great, just what I expected";
7 %else %put "This is wrong";
8 %mend;
9 %test;
50002
"Great, just what I expected"
Have fun.
_______________________________________________________
Debasmit SR Mohanty
GE Capital , India
http://www.angelfire.com/me/debasmit
The opinion herein expressed are of mine and doesn't
reflect that of my employer
_______________________________________________________
----------
From: Lanning, Chris [SMTP:clanning@AMGEN.COM]
Sent: Friday, November 13, 1998 7:59 AM
To: SAS-L@UGA.CC.UGA.EDU
Subject: Confused on %sysfunc(filename(...)) statement
HELP!!!
I cannot figure this one out. I have a small macro below that
hopefully
tests for the existence of a directory . This directory does not
exist on
my PC system, so I expected to see "Great, just what I expected" but
was
disappointed and alarmed when I got "This is wrong". The code and
the
output are below. I am using SAS 6.12 on a windows 95 system.
%macro test;
%let rc=%sysfunc(filename(mydir,'c:\950212'));
%put &rc;
%if &rc ne 0 %then %put "Great, just what I expected";
%else %put "This is wrong";
%mend;
%test;
run;
Here is the output...
557 %macro test;
558 %let rc=%sysfunc(filename(mydir,'c:\950212'));
559 %put &rc;
560 %if &rc ne 0 %then %put "Great, just what I expected";
561 %else %put "This is wrong";
562
563 %mend;
564
565 %test;
SYMBOLGEN: Macro variable RC resolves to 0
0
SYMBOLGEN: Macro variable RC resolves to 0
"This is wrong"
566
567 run;
568
By the way, when I tried the same macro with a "data _null_; ...
filename(...); setup, it appeared to work. I do not get it.
Thanks in Advance,
Chris
Chris Lanning
Trilogy Consultant
clanning@amgen.com
1-805-447-0634
SAS Consulting is my life!!!
|