Date: Wed, 27 Jan 2010 07:33:49 -0800
Reply-To: Ruby <windofoct@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ruby <windofoct@GMAIL.COM>
Organization: http://groups.google.com
Subject: SAS code help
Content-Type: text/plain; charset=ISO-8859-1
hi SAS experts,
I need to read some raw data files into sas. However, the files name
has an invalid "-' sign in it. So, I tried to modify the old program
by adding a new variable "sourcefile1" but with no success. Can anyone
here help to explain why my codes did not work? I added a "/***/" mark
after my codes.
Also, do you have a good way to read the files in without changing the
file names manually?
Thanks very much!!!
filename mydir pipe " dir /B /N Q:\rawdata\*.txt";
data enc(drop=trailer records totamtpaid)
trailer(keep=trailer records totamtpaid);
infile mydir truncover;
input sourcefile $50;
length sourcefile1 $50; /***/
sourcefile1=translate(sourcefile,'_', '-'); /***/
fil2read="Q:\rawdata\"||sourcefile1; /***/
infile dummy filevar=fil2read end=done lrecl=239 truncover ;
do while (not done);
input ....
|