|Date: ||Mon, 25 Mar 2002 09:51:58 -0500|
|Reply-To: ||"David L. Ward" <dward@SASHELP.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||"David L. Ward" <dward@SASHELP.COM>|
|Subject: ||Re: Portable SAS code..|
|Content-Type: ||text/plain; charset="iso-8859-1"|
I have initialized a 1-byte string at the start of my applications to the
proper directory delimiter based on the operating system. You can scan the
physical path of the WORK libname to determine which delimiter is used, then
in your code something like:
do while(i<=length(work) and dirDlm='');
if substr(work,i,1) in ('/' '\') then dirDlm=substr(work,i,1);
(untested right now)
Or I suppose you could write a method that would translate the file path
according to the current OS and code them all the same.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Richard
Sent: Monday, March 25, 2002 9:30 AM
Subject: Re: Portable SAS code..
"Alastair Nicol" <calaban.madness@BLUEYONDER.CO.UK> wrote in message
> i'm writting a Python / SAS app which i would like to run on both
> and unix (min). The SCL code works fine under windows, but i've never
> SAS under Unix (and havnt got sas for linux to test!)
> 1. whats the best way round the "\" "/" problem (or does SAS do this for
> you). best i can up with is if os=unix then sep=''/';else sep="\".
> 2. any other issues (there are NO frame entries, its batch SCL).
> all nums are 8 in length (only ints being used anyway)
> the scl source is already saved as text files so cat problems arnt an
> ive a macro to compile this into a catalog
> also, do SAS TCP/IP sockets (filename and fopen/ fgets etc) work the
> way under unix. i assume they do.
> Thanks, Alastair
In SAS Version 6.12 and 8 for Windows, SAS will auto-translate directory
will show in the log
NOTE: The file 'c:/temp/xyz.lst' is:
NOTE: 1 record was written to the file 'c:/temp/xyz.lst'.
The minimum record length was 3.
The maximum record length was 3.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
So, as long as you keep things to relative paths, you won't have to worry
about anything. If you use absolute paths you have to worry about how to
indicate the root.
Richard A. DeVenezia
Need long HTML Titles and Footnotes ?