[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Call OS to copy output file



The perfect solution.  Thank you!  By the way, I added the /c flag to return me to SQR after the copy completed (otherwise I sat there at a blue DOS window).  Worked like a champ.  Again, many thanks to John and Steven.

-Yuri


>From: "Fetzik, John"

>Reply-To: sqr-users@list.iex.net
>To: SQR-USERS@list.iex.net
>Subject: Re: Call OS to copy output file
>Date: Fri, 7 Sep 2001 08:55:15 -0500
>
>Hello,
>
>The copy command is 'DOS' internal command, not a separate executable. Thus
>to use it you need to actually call command.com with copy as a parameter.
>The path for command.com can usually be found using the COMSPEC environment
>variable. So try the following.
>
> let $copy_command = getenv('COMSPEC') || ' copy ' || $file1 || ' ' ||
>$new_file1
>
>Make sure you have a space before the word copy.
>
>For more information on command.com, its optional parameters, and internal
>'DOS' commands, check out this web page.
>
>http://www.mvps.org/serenitymacros/dos7.html
>
>John S. Fetzik
>S&C Electric Company
>773-338-1000 x2763
>jfetzik@sandc.com
>
>-----Original Message-----
>From: Yuri Hunter [mailto:lakef250@HOTMAIL.COM]
>Sent: Thursday, September 06, 2001 4:48 PM
>To: SQR-USERS@list.iex.net
>Subject: Call OS to copy output file
>
>
>Greetings -
>
>I'm having trouble copying an output file (not a .lis file) that gets
>created using WRITE command. I build the DOS command as follows and am
>closing the file before attempting to copy:
>
> let $filedate = edit(datenow(), 'YYYYMMDD')
> close 1
> let $new_file1 = {PATH} || $filedate || '_' || {FILE1} || {EXTENSION}
> let $copy_command = 'copy ' || $file1 || ' ' || $new_file1
> call system using $copy_command #status
>
>This errors with a return code of 2. Any idea what's going on? Does SQR
>"hold" onto a file until the program terminates? Is there a way to do this
>within the SQR program?
>
>Thanks for any tips,
>Yuri


Get your FREE download of MSN Explorer at http://explorer.msn.com