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 2010, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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>
Subject:      SAS code help
Comments: To:
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 ....

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