From: Joe Matise on
Are you sure you're running the X command and the DOS prompt in the same
folder? Perhaps CLIP is not in a directory in the path?

-Joe

On Tue, Mar 9, 2010 at 11:02 AM, js8765 <js8765(a)googlemail.com> wrote:

> Hi there,
>
> I was wondering if anyone has ever experienced something similar to this.
>
> When I run the following command at the DOS prompt it works fine:
> clip < c:\temp\init.txt
>
> ...but if I run the following line in SAS, it does not work. i.e. the
> contents to not get copies to the clipboard.
> x "clip < c:\temp\init.txt";
>
> The program 'clip' copies the contents of a file to the clipboard. The
> file clip.exe is standard in Windows Server 2003 Server but I am running
> XP and downloaded it from the Microsoft website
>
> Does anyone have any idea why this might be happening?
>
> Thanks in advance for any help!
>
> js
>
From: "Data _null_;" on
How about using SAS and the CLIPBRD access method.

Syntax
FILENAME fileref CLIPBRD <BUFFER=paste-buffer-name>;

Arguments

fileref
is a valid fileref.

CLIPBRD
specifies the access method that enables you to read data from or
write data to the clipboard on the host machine.

BUFFER=paste-buffer-name
creates and names the paste buffer. You can create any number of paste
buffers by naming them with the BUFFER= argument in the STORE command.
--------------------------------------------------------------------------------

Details

The FILENAME statement, CLIPBOARD Access Method enables you to share
data within SAS and between SAS and applications other than SAS.



On 3/9/10, js8765 <js8765(a)googlemail.com> wrote:
> Hi there,
>
> I was wondering if anyone has ever experienced something similar to this.
>
> When I run the following command at the DOS prompt it works fine:
> clip < c:\temp\init.txt
>
> ...but if I run the following line in SAS, it does not work. i.e. the
> contents to not get copies to the clipboard.
> x "clip < c:\temp\init.txt";
>
> The program 'clip' copies the contents of a file to the clipboard. The
> file clip.exe is standard in Windows Server 2003 Server but I am running
> XP and downloaded it from the Microsoft website
>
> Does anyone have any idea why this might be happening?
>
> Thanks in advance for any help!
>
> js
>
From: Michael Raithel on
Dear SAS-L-ers,

JS posted the following:

> Hi there,
>
> I was wondering if anyone has ever experienced something similar to
> this.
>
> When I run the following command at the DOS prompt it works fine:
> clip < c:\temp\init.txt
>
> ...but if I run the following line in SAS, it does not work. i.e. the
> contents to not get copies to the clipboard.
> x "clip < c:\temp\init.txt";
>
> The program 'clip' copies the contents of a file to the clipboard. The
> file clip.exe is standard in Windows Server 2003 Server but I am
> running
> XP and downloaded it from the Microsoft website
>
> Does anyone have any idea why this might be happening?
>
> Thanks in advance for any help!
>
> js

JS, if you do not get a satisfactory answer on using CLIP with the X command, I have another route you may decide to travel. Consider using the CLIPBOARD Access Method on the FILENAME statement. You can read from and WRITE TO the clipboard by carefully setting up your FILENAME statement and then using DATA _NULL_ steps.

You can read all about the CLIPBOARD Access Method in the SAS 92. Language Reference: Dictionary, Second Edition:

http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a002571877.htm

I have been playing around with it, but have not used it in any serious programs. But, it is quite cool.

JS, best of luck in all your SAS endeavors!


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(a)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

Author: The Complete Guide to SAS Indexes
http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=60409

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
It's always darkest before the dawn. So if you're going to
steal your neighbor's newspaper, that's the time to do it. - Anonymous
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
From: Arthur Tabachneck on
JS,

No, I hadn't tried it before (and didn't even know there was such a
command) but, as I'm on a Windows 2003 server, gave it a try. And, indeed
it did work from a DOS command prompt, but not via a run command or any of
the SAS alternatives.

Then I opted to try a method and, to my surprise, it actually DID work.

It requires two steps. First, write your command to a .bat file. The
file I created was c:\doit.bat and it contained one line, namely:
clip < c:\testthis.txt

Then, in SAS I ran x "c:\doit";

Worked like a charm.

Art
--------
On Tue, 9 Mar 2010 18:02:03 +0100, js8765 <js8765(a)GOOGLEMAIL.COM> wrote:

>Hi there,
>
>I was wondering if anyone has ever experienced something similar to this.
>
>When I run the following command at the DOS prompt it works fine:
>clip < c:\temp\init.txt
>
>...but if I run the following line in SAS, it does not work. i.e. the
>contents to not get copies to the clipboard.
>x "clip < c:\temp\init.txt";
>
>The program 'clip' copies the contents of a file to the clipboard. The
>file clip.exe is standard in Windows Server 2003 Server but I am running
>XP and downloaded it from the Microsoft website
>
>Does anyone have any idea why this might be happening?
>
>Thanks in advance for any help!
>
>js