Date: Wed, 17 Mar 2004 13:16:37 -0500
Reply-To: Randy Herbison <RandyHerbison@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Randy Herbison <RandyHerbison@WESTAT.COM>
Subject: Re: how to include the responsed result of X statement into Log w
indow?
Content-Type: text/plain
Zibao,
Here are two ways to see the results of a host system command in the SAS
log:
52 data _null_;
53 rc=system('COPY c:\temp\test.txt c:\temp\test2.txt');
54 put rc=;
55 rc=system('NOCOMMAND');
56 put rc=;
57 run;
rc=0
rc=9009
NOTE: DATA statement used:
real time 7.07 seconds
cpu time 0.01 seconds
58
59 filename test pipe "copy c:\temp\test.txt c:\temp\test2.txt'";
60 data _null_;
61 infile test;
62 input;
63 put _infile_;
64 run;
NOTE: The infile TEST is:
Unnamed Pipe Access Device,
PROCESS=copy c:\temp\test.txt c:\temp\test2.txt',
RECFM=V,LRECL=256
1 file(s) copied.
NOTE: 1 record was read from the infile TEST.
The minimum record length was 25.
The maximum record length was 25.
NOTE: DATA statement used:
real time 0.04 seconds
cpu time 0.03 seconds
74 filename test pipe "badcopy c:\temp\test.txt c:\temp\test2.txt'";
75 data _null_;
76 infile test;
77 input;
78 put _infile_;
79 run;
NOTE: The infile TEST is:
Unnamed Pipe Access Device,
PROCESS=badcopy c:\temp\test.txt c:\temp\test2.txt',
RECFM=V,LRECL=256
Stderr output:
'badcopy' is not recognized as an internal or external command,
operable program or batch file.
NOTE: 0 records were read from the infile TEST.
NOTE: DATA statement used:
real time 0.09 seconds
cpu time 0.00 seconds
RandyHerbison@westat.com
-----Original Message-----
From: Zibao Zhang [mailto:zibaozhang@HOTMAIL.COM]
Sent: Wednesday, March 17, 2004 12:16 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: how to include the responsed result of X statement into Log window?
Hi all,
Is it possible to get the DOS command results as part of SAS log file? For
example,
data _null_;
x " copy ....";
run;
When checking the log file, I couldn't find if the COPY command executed
successfully because there is no any infomation about result of this
command. i need the results of DOS command to decide the following
precessing.
Thanks in advance.
Zibao