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 (May 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 23 May 2006 11:58:03 -0700
Reply-To:   dennis.pong@GMAIL.COM
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   dennis.pong@GMAIL.COM
Organization:   http://groups.google.com
Subject:   Is there any limitations on filename statement in a macro?
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset="iso-8859-1"

%macro import_all_countries (path =, filename= , in =, out = , fileout=); filename &in "&path&filename"; filename &out "&path&fileout";

data _null_ ; length result header $ 256; infile &in /*end = eof*/; file &out ;

result=" "; input ; if _N_ eq 1 then do;

result = substr (_infile_, indexc(_infile_, '"'), length(_infile_) - (indexc(_infile_, '"') -1)); header = scan(_infile_, 1, '"') ; header = '"'||compress(tranwrd(header,',','"'||'09'x||'"'),' ')||'"'; put header; put result;

end; else /*if _N_ < 4 then */ put _infile_;

run;

proc import datafile= "&out" out=work.test dbms=dlm replace; delimiter = '09'x; getnames = yes; GUESSINGROWS=3276; run;

%mend import_all_countries ;

%Let path =J:\Tobedeletedby060531\; %Let filename =demo_quarterly_spool_AU.dat; %Let in = AU_demos; %Let out = AU_cleaned; %Let fileout =SE_demos_cleaned.dat; %import_all_countries (path = &path, filename = &filename, in = &in, out = &out , fileout = &fileout);

And this is the error in the log.

ERROR: Invalid logical name. ERROR: Error in the FILENAME statement.

I really don't understand why there's a restriction on the filename... Did someone encounter a similar problem?


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