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 1997, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 30 Jan 1997 06:40:42 -0500
Reply-To:   Tra <Tra@PROTEUS.CO.UK>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Tra <Tra@PROTEUS.CO.UK>
Subject:   Filenames and pathnames in DATA Step.

I am writing a data step program to read a some data, incidentally from an Excel spreadsheet. One field in the spreadsheet will be the name of an ascii file. I want the data step to 1. verify the file exists and can be opened 2. work out the full path of the file (including drive and subdirectory)

I tried to use SCL functions filename and pathname in the data step as in the following fragment:

data _null_; length filename pthname $ 200; input filename; fok = filename('DATA1', filename); put filename= fok=; pthname = 'unset'; pthname = pathname('DATA1'); put pthname=; cards; crdassay.sas run; filename data1 list; data _null_; length pthname $ 200; pthname = 'unset'; pthname = pathname('DATA1'); put pthname=; run;

However, although the filename statement works ok and DATA1 is assigned correctly, the pathname function appears to always return blank.

Anybody knows why this does not work, or suggestions for alternative ways to handle this.

Many Thanks

Tim Auton Proteus Molecular Design Ltd


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