Date: Tue, 6 Dec 2005 18:06:35 -0500
Reply-To: Mike Rhoads <RHOADSM1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Rhoads <RHOADSM1@WESTAT.COM>
Subject: Re: Alternative to system command for SAS controlled PDF file
transfer
Content-Type: text/plain; charset="iso-8859-1"
Dietrich,
I'm glad to hear that my colleague, the other MR, has come up with a good solution to your problem!
Another avenue that may be worth exploring in some instances as an alternative to the X statement or CALL SYSTEM in a Windows environment is using the MODULEN or MODULEC functions, which enable you to access Windows API routines directly from within SAS.
For more information and examples, see Richard DeVenezia's excellent web site at http://www.devenezia.com/downloads/sas/sascbtbl/
Mike Rhoads
Westat
RhoadsM1@Westat.com
-----Original Message-----
From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of Dietrich Alte
Sent: Tuesday, December 06, 2005 10:58 AM
To: Michael Raithel; sas-l@uga.edu
Subject: Re: Alternative to system command for SAS controlled PDF file transfer
Sorry, I must correct myself.
The focus thing is still going on,
but I can work now.
It keeps in the backgroud somehow.
Thanks again. xmin has made it :-)
Dietrich
Dietrich Alte schrieb:
> Thanks Michael,
>
> for your longish and excellent reply. I was aware of xwait xsync. xmin
> was partly new to me. I have checked it. The windows are very small now
> with xmin, but still appear (inspite if having noxwait noxsysnc), and
> they get the WIN focus, leading to the same situation as before. Every
> other program looses the focus every other second.
>
> I fear a DOS-Box will always come on top, thus no SAS statement that
> opens a DOS box will help.
> Is it possible to move files on the system level (without changing them)
> with other SAS statements in SCL etc.?
>
> Dietrich
>
> Michael Raithel wrote:
>
>> Dear SAS-L-ers,
>>
>> Dietrich posted the following question:
>>
>>
>>> Dear all,
>>>
>>> from time to time I need to copy several 1000 (ca. up to
>>> 10000) PDF files that reside in ~150 well structured
>>> subdirectories to another location. As I select these out of
>>> about the double number of files by date, I don't want to do
>>> that by hand, but let SAS do it. Part of my program goes:
>>>
>>> data _null_;
>>> set TEMP nobs=nobs;
>>> format pct 3.0;
>>> X_Cmd = compbl("copy
>>> &TeleEKG\"||compress(Kartennummer)||"\"||compress(name)||"
>>> &TEMP\"||compress(kartennummer)||"\"||compress(name));
>>> pct = 100*_n_/nobs;
>>> RC = system (X_Cmd);
>>> run;
>>>
>>> Alas, the system command makes the DOS box showing up, and
>>> working is then not possible for about an hour until the
>>> files are copied. Are there any means inside SAS alternative
>>> to SYSTEM to copy files without having the DOS box popping up?
>>>
>>> (WIN XP pro, SAS 9.1.3 SP3)
>>>
>>
>>
>> Dietrich, I can think of two strategies that you could employ:
>>
>> 1. Single-click on your SAS program in Windows Explorer, then right
>> click and "Batch Submit with SAS x.x" on the drop-down list. That will
>> allow your program to execute in batch, in the background where it will
>> be out-of-sight-out-of-mind while you perform other important tasks.
>>
>> 2. Code the following option statement:
>>
>> options noxwait xmin noxsync;
>>
>> These options will perform the following for your online SAS session:
>>
>> noxwait - specifies that the command processor automatically returns to
>> the SAS session after the specified command is executed. You do not have
>> to type EXIT.
>>
>> xmin - specifies to start the application specified in the X command in
>> a minimized state.
>>
>> noxsync - specifies that the operating system command execute
>> asynchronously with your SAS session. That is, control is returned
>> immediately to SAS and the command continues executing without
>> interfering with your SAS session. With NOXSYNC in effect, you can
>> execute an X command or X statement and return to your SAS session
>> without closing the process spawned by the X command or X statement.
>>
>> All of the explanations, above, come to you courtesy of SAS Online
>> Documentation. I use these options in my own programs so that I can
>> wrestle control back from the X command and go on my merry programming
>> way.
>>
>> Dietrich, best of luck to you as you disentangle yourself from your
>> long-running X commands and reclaim that lost hour of productive work!
>>
>> I hope that this suggestion proves helpful now, and in the future!
>>
>> Of course, all of these opinions and insights are my own, and do not
>> reflect those of my organization or my associates. All SAS code and/or
>> methodologies specified in this posting are for illustrative purposes
>> only and no warranty is stated or implied as to their accuracy or
>> applicability. People deciding to use information in this posting do so
>> at their own risk.
>>
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> Michael A. Raithel
>> "The man who wrote the book on performance"
>> E-mail: MichaelRaithel@westat.com
>> Author: Tuning SAS Applications in the MVS Environment
>> Author: Tuning SAS Applications in the OS/390 and z/OS Environments,
>> Second Edition
>> http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=58172
>>
>> Currently Writing: The Complete Guide to SAS Indexes (due February 28,
>> 2006)
>>
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> One machine can do the work of fifty ordinary men. No machine
>> can do the work of one extraordinary man. - Elbert Hubbard
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>
>
--
----------------------------------------------------------------
DIETRICH ALTE, Dipl.-Statistiker, Dr. rer. med.
Institut für Epidemiologie & Sozialmedizin
--> Studien-Management "Study of Health in Pomerania (SHIP)"
EMA-Universität Greifswald - Medizinische Fakultät
Walther-Rathenau-Str. 48, D-17487 Greifswald, Germany
URL www.medizin.uni-greifswald.de/epidem/
Phone ++49(0)3834-867713, Fax ++49(0)3834-866684
----------------------------------------------------------------
|