I am wanting to know if there is a way to output to desktop so I can output to 
the desktop like I would a folder eg c:\myfolder\

What you need to know is that the "desktop" is simply a folder on your 
computer.  You can read and write files in this folder exactly like any other 
folder.  You only need to know where the folder is.  This is a little tricky 
because the location of this folder has changed in different versions of 
windows (from C:\Documents and Settings\<USERNAME>\Desktop to 
C:\Users\<USERNAME>\Desktop) and because it's actually possible to change the 
location of the desktop folder (if, for instance, you want it stored on a 
different hard drive).
Fortunately, R:Base can tell you where the user folder is and the Desktop 
folder is always inside the user folder.  To find the Desktop folder do:
SET VAR vUserFolder = (ENVVAL('USERPROFILE'))SET VAR vDesktopFolder = 
(.vUserFolder + '\Desktop')
Now, vDesktopFolder contains the folder into which you can write any file that 
you want to appear on the desktop and your code is guaranteed to work on older 
and new versions of Windows, and for users who have moved their Desktop folder 
someplace weird.
To send output to a file in that folder you would do this:
SET VAR vOutputFile = (.vDesktopFolder + '\Results.TXT')OUTPUT 
.vOutputFileWRITE 'Here are the results:'SELECT * FROM ResultsTableOUTPUT SCREEN
One thing to think about is that if your process is not very, very quick the 
file will probably appear on the desktop while you're still writing to it.  In 
that case you would want to generate the file in another folder and then, only 
after it's completely written, use COPY to move it the desktop folder.--Larry
   <!--#yiv0874981452 filtered {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 
2 4;}#yiv0874981452 filtered {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 
4;}#yiv0874981452 filtered {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 
4;}#yiv0874981452 filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 
4;}#yiv0874981452 p.yiv0874981452MsoNormal, #yiv0874981452 
li.yiv0874981452MsoNormal, #yiv0874981452 div.yiv0874981452MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New 
Roman", "serif";}#yiv0874981452 a:link, #yiv0874981452 
span.yiv0874981452MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv0874981452 a:visited, #yiv0874981452 
span.yiv0874981452MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv0874981452 
p.yiv0874981452MsoAcetate, #yiv0874981452 li.yiv0874981452MsoAcetate, 
#yiv0874981452 div.yiv0874981452MsoAcetate 
{margin:0in;margin-bottom:.0001pt;font-size:8.0pt;font-family:"Tahoma", 
"sans-serif";}#yiv0874981452 span.yiv0874981452EmailStyle17 
{font-family:"Calibri", "sans-serif";color:#1F497D;}#yiv0874981452 
span.yiv0874981452BalloonTextChar {font-family:"Tahoma", 
"sans-serif";}#yiv0874981452 span.yiv0874981452EmailStyle20 
{font-family:"Calibri", "sans-serif";color:#1F497D;}#yiv0874981452 
.yiv0874981452MsoChpDefault {font-size:10.0pt;}#yiv0874981452 filtered 
{margin:1.0in 1.0in 1.0in 1.0in;}#yiv0874981452 div.yiv0874981452WordSection1 
{}-->

Reply via email to