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 (February 1998, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 5 Feb 1998 00:12:56 -0000
Reply-To:     Jeff Tomlinson <Jeff@KITTSOFT.DEMON.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Jeff Tomlinson <Jeff@KITTSOFT.DEMON.CO.UK>
Subject:      Re: Question:  AF/SCL Variable for Windows E
Comments: To: Donalee Wanna <dwanna@dekalb.com>
Content-Type: text/plain; charset="iso-8859-1"

-----Original Message----- From: Donalee Wanna <dwanna@DEKALB.COM> Newsgroups: bit.listserv.sas-l To: SAS-L@VM.MARIST.EDU <SAS-L@VM.MARIST.EDU> Date: 04 February 1998 18:00 Subject: Question: AF/SCL Variable for Windows E

>Hi All, > >I have a quick question I hope you can help with. This project that I am >working on requires us to look at a file in c:\windows. However, we just >discovered that on NT the directory is called something different. Now we >have to try to have our SCL look for this file in where ever the windows >system is found. Do you know how to call the system variable (and what ever >that would be) which is set for this? > >Maybe to help clarify this, here is the current code: > >INIT: > length expid $6 and so on; > call wname('Test'); > protect _all_; > call symput('endsas','endsas'); > rc=optsetn('xwait',0); > windir='c:\windows'; *here is the problem; > if not fileexist(windir || '\abc.ini') then do; > call display('massage.frame', 'File not found.','ERROR'); > end; > > >As you can see if there is not a c:\windows, then there is an error. HELP > >Thanks, >Donalee Wanna >DEKALB Genetics Corp. >phone: 815/758-9174 >e-mail: dwanna@dekalb.com

Well ... from a DATA step I would use a MODULE function to call the GetWindowsDirectoryA windows function :- filename sascbtbl 'sascbtbl.dat'; data _null_; length windir $200; n = modulen("*ie", "KERNEL32,GetWindowsDirectoryA", windir, 199); put n= windir=; run;

the SASCBTBL.DAT file contains the definition of the "GetWindowsDirectoryA" Windows function :-

routine GetWindowsDirectoryA minarg=2 maxarg=2 stackpop=called returns=long; arg 1 update format=$cstr200.; arg 2 input byvalue format=pib4.;

The when run on Win 95 the log file contains :- 193 194 filename sascbtbl 'sascbtbl.dat'; 195 data _null_; 196 length windir $200; 197 n = modulen("*e", "KERNEL32,GetWindowsDirectoryA", windir, 199); 198 put n= windir=; 199 run; NOTE: Variable WINDIR is uninitialized. N=10 WINDIR=C:\W95OSR2 NOTE: The DATA statement used 0.05 seconds.

And on Windows NT 1 2 filename sascbtbl 'f:\sas\sascbtbl.dat'; 3 data _null_; 4 length windir $200; 5 n = modulen("*e", "KERNEL32,GetWindowsDirectoryA", windir, 199); 6 put n= windir=; 7 run; NOTE: Variable WINDIR is uninitialized. N=8 WINDIR=D:\WINNT NOTE: The DATA statement used 1.29 seconds.


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