<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213622#M16042</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But macro variable SASWORKLOCATION is not cleared, right? Whe I check its value with %put &amp;amp;SASWORKLOCATION, it is always there in the SAS EG session, before or after I run the customer task.&lt;/P&gt;&lt;ADDRESS&gt;Also, when I add the line 3 - 5 in my code (a submitter), the line 7 ( wkg = getMacro("SASWORKLOCATION"); ) works. Why submit a line of SAS code in the middle makes it works?&lt;/ADDRESS&gt;&lt;ADDRESS&gt; &lt;/ADDRESS&gt;&lt;ADDRESS&gt;Thanks!&lt;/ADDRESS&gt;&lt;ADDRESS&gt;Yihong&lt;/ADDRESS&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 May 2015 20:43:10 GMT</pubDate>
    <dc:creator>yhz</dc:creator>
    <dc:date>2015-05-26T20:43:10Z</dc:date>
    <item>
      <title>Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213609#M16029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to study and use your SAS Harness, but find out that the SAS workspace server only allow me to connect through SAS EG. When I try to connect to workspace server using SAS Harness, it give me error mesage saying I don't have permission. My question is can I use COM protocol to connect to our SAS Unix server instead of workspace server (that is set on a different unix node). If it can be done, do you have an example? This is more useful, because all our data and programs are on this SAS unix server.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yihong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 14:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213609#M16029</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-05-12T14:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213610#M16030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Through Object Broswer, I saw the following. They all need a local SAS server, right? So for SAS EG that has no local server, they cannot be used?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS.Tasks.Toolkit.SasServer.CopyLocalFileToServer(string)&lt;/P&gt;&lt;P&gt;SAS.Tasks.Toolkit.SasServer.CopyServerFileToLocal(string, string, string)&lt;/P&gt;&lt;P&gt;SAS.Tasks.Toolkit.SasServer.CopyServerFileToLocal(string, string)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or ask the question in a different way. do you have examples to do the following for SAS EG on Unix server without local server:&lt;/P&gt;&lt;P&gt;1. Transfer a local text file to Unix.&lt;/P&gt;&lt;P&gt;2. Transfer a unix text file to Local.&lt;/P&gt;&lt;P&gt;3. Transfer a SAS dataset from Unix to Local.&lt;/P&gt;&lt;P&gt;4. Transfer a SAS dataset from Local to Unix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These will be very helpful for me to start.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 15:59:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213610#M16030</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-05-12T15:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213611#M16031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yihong,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, the "Local" in these method names is "local PC" -- no Local SAS is required.&amp;nbsp; I'll try to come up with a simple example that you can use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 20:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213611#M16031</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-05-12T20:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213612#M16032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That will be great!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yihong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 20:31:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213612#M16032</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-05-12T20:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213613#M16033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While waiting for the file and data transfer examples, I have another question.&lt;/P&gt;&lt;P&gt;In the following is the code in your book page 64. I get erroes as shoown in the mouse on message shown.&lt;/P&gt;&lt;P&gt;I do have SAS.Tasks.Toolkit reference added and have using SAS.Tasks.Toolkit; and using SAS.Tasks.Toolkit.Data; on top of my program. Anything elsse I am missing?&lt;/P&gt;&lt;P&gt;Also, in the TopN example, I can not find this piece of code to see how it is used. Where can I find it in the TopN example?&lt;/P&gt;&lt;P&gt;Thakns!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yihong&lt;/P&gt;&lt;P&gt;&lt;IMG alt="File_Dialog_Question.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10512_File_Dialog_Question.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 17:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213613#M16033</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-05-19T17:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213614#M16034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yihong, sorry for the delay on this.&amp;nbsp; Here's a C# example of copying a file from "SASApp" to the local PC.&amp;nbsp; This example has several hardcoded values, so you'll need to adapt for your own situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14320601440434877" jivemacro_uid="_14320601440434877" modifiedtitle="true"&gt;
&lt;P&gt;using SAS.Tasks.Toolkit;&lt;/P&gt;
&lt;P&gt;/* ... */&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// initialize the path of the source file on the SAS server&lt;/P&gt;
&lt;P&gt;// ex: '/u/myid/data/test.csv'&lt;/P&gt;
&lt;P&gt;string filename = txtFile.Text;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// assuming filename ends with extension&lt;/P&gt;
&lt;P&gt;// results in 'csv', for example&lt;/P&gt;
&lt;P&gt;string ext = filename.Split('.')[filename.Split('.').Length - 1];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// get an object that represents the SAS server session&lt;/P&gt;
&lt;P&gt;SasServer s = new SasServer("SASApp");&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// copies to a local TEMP folder, returns the full path where &lt;/P&gt;
&lt;P&gt;// it was copied to&lt;/P&gt;
&lt;P&gt;string dest = s.CopyServerFileToLocal(filename, "test", ext);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;MessageBox.Show("Copied file to " + dest);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll see a message like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; Copied file to C:\Users\sascrh\AppData\Local\Temp\SEG1896\ekecsy3k.2hj\test.csv&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 18:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213614#M16034</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-05-19T18:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213615#M16035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yihong,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add these &lt;STRONG&gt;using&lt;/STRONG&gt; directives to the top of your file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14320604824108623" jivemacro_uid="_14320604824108623"&gt;
&lt;P&gt;using System.Collections.ObjectModel;&lt;/P&gt;
&lt;P&gt;using System.Collections.Generic;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can always right-click on the "offending" keyword and select &lt;STRONG&gt;Resolve&lt;/STRONG&gt; to see if Visual Studio has any suggestions for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 18:34:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213615#M16035</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-05-19T18:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213616#M16036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a wonderful way of transfer file from server to local. Very handy to use and much easier than I expected.&lt;/P&gt;&lt;P&gt;Thank you very much for this example!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yihong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 20:50:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213616#M16036</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-05-19T20:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213617#M16037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have another question. In the Training book, page 4-11 (as shown in the attached), can you send me the more specific link to the Task API and Toolkit Documentation. From the link: &lt;A href="http://go.sas.com/customtasksapi"&gt;http://go.sas.com/customtasksapi&lt;/A&gt; I cannot find what it is shown in the slide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Yihong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 12:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213617#M16037</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-05-21T12:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213618#M16038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yihong,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's &lt;A href="http://support.sas.com/documentation/onlinedoc/guide/customtasks/samples/zqj_EG42CustomTasks.zip"&gt;the Reference Documentation link&lt;/A&gt; from that page.&amp;nbsp; It's a ZIP file with a CHM (Microsoft Help file) and some PDFs.&amp;nbsp; The CHM file has the reference info.&amp;nbsp; A&lt;SPAN style="font-size: 13.3333330154419px;"&gt;fter extracting it from the ZIP file,&amp;nbsp; y&lt;/SPAN&gt;ou might need to right-click on the CHM file, choose Properties and select &lt;STRONG&gt;Unblock&lt;/STRONG&gt; in the security settings.&amp;nbsp; Microsoft Windows often blocks CHM content from "untrusted" sources (the Internet).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 12:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213618#M16038</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-05-21T12:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213619#M16039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Chris! This is very helpful!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yihong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 12:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213619#M16039</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-05-21T12:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213620#M16040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question about reading the SAS Macro variable. See the following code. I have a method getMacro(string varName) from line 9. In line 1, I call the method to read AUTOMATIC macro variable SYSUSERID. It alwars works. In line 7, I call the same method again to read GLOBAL macro variable SASWORKLOCATION. It is not working. But if I add a submitter as shown in line 3 to line 5, it will work. It works for my purpose, but I like to know why it behaves like this. Can you help explain?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Yihong&lt;/P&gt;&lt;P&gt;============================================================================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string userID = "";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string wkg = "";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userID = getMacro("SYSUSERID"); MessageBox.Show(userID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SAS.Tasks.Toolkit.SasSubmitter submitter = new SAS.Tasks.Toolkit.SasSubmitter("SASApp");&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string log;&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; submitter.SubmitSasProgramAndWait("%let wkc = %sysfunc(getoption(work));", out log);&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wkg = getMacro("SASWORKLOCATION");&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string getMacro(string varName)&lt;/P&gt;&lt;P&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Consumer.AssignedServer is the active server from SAS EG &lt;/P&gt;&lt;P&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SasServer s = new SasServer(Consumer.AssignedServer);&lt;/P&gt;&lt;P&gt;13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string vName = s.GetSasMacroValue(varName); MessageBox.Show(vName);&lt;/P&gt;&lt;P&gt;14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return vName;&lt;/P&gt;&lt;P&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 17:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213620#M16040</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-05-26T17:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213621#M16041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yihong,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macro variables that SAS Enterprise Guide creates when it submits a program/task are also "cleared" at the end of the task.&amp;nbsp; You'll see the following code added to each task/program in the log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%LET _CLIENTTASKLABEL=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%LET _CLIENTPROJECTPATH=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%LET _CLIENTPROJECTNAME=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%LET _SASPROGRAMFILE=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;This means that these macro variables are NOT defined when you check their values "in between" tasks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Chris&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 20:17:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213621#M16041</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-05-26T20:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213622#M16042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But macro variable SASWORKLOCATION is not cleared, right? Whe I check its value with %put &amp;amp;SASWORKLOCATION, it is always there in the SAS EG session, before or after I run the customer task.&lt;/P&gt;&lt;ADDRESS&gt;Also, when I add the line 3 - 5 in my code (a submitter), the line 7 ( wkg = getMacro("SASWORKLOCATION"); ) works. Why submit a line of SAS code in the middle makes it works?&lt;/ADDRESS&gt;&lt;ADDRESS&gt; &lt;/ADDRESS&gt;&lt;ADDRESS&gt;Thanks!&lt;/ADDRESS&gt;&lt;ADDRESS&gt;Yihong&lt;/ADDRESS&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 20:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213622#M16042</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-05-26T20:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213623#M16043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yihong,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ah, I see what you mean.&amp;nbsp; The GetSasMacroValue is actually performing a data query, something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Consolas; font-size: 11pt;"&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; &lt;BR /&gt;&amp;nbsp; sashelp.vmacro &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; name=&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"SASWORKLOCATION"&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure why it would behave differently -- except this: the SASWORKLOCATION macro variable is not initialized until &lt;STRONG&gt;after &lt;/STRONG&gt;the first program or task is submitted from SAS Enterprise Guide.&amp;nbsp; So if you start EG then immediately run your custom task, which then queries this value before anything else happens -- then the value will not yet have been set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 20:51:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213623#M16043</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-05-26T20:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213624#M16044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you are right. I run this code first in a new SAS EG session: %let wkc = %sysfunc(getoption(work)); %put &amp;amp;wkc;&lt;/P&gt;&lt;P&gt;Then run the Customer Task without the submitter (line 3-5), the line 7 ( wkg = getMacro("SASWORKLOCATION"); ) works.&lt;/P&gt;&lt;P&gt;Thanks for your explanation!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yihong &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 21:04:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213624#M16044</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-05-26T21:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213625#M16045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code from your answer on May 19 works very well. But my new question is, this code copy the file to a temporal directory, there is no place can specify where user want the file go. After this, is there a way to copy this temporal file to a user specified local directory? The simple C# File.Copy(source, dest) is not working because it cannot find any local directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, thank you so much for the class and helps!!! My unix terminal frame are all worked out like my PC SAS version. Still improving and develop new things.&lt;/P&gt;&lt;P&gt;Yihong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 14:36:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213625#M16045</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-06-09T14:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213626#M16046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sorry that I am not sure if my early question today was posted successfully. If it is posted, please ignore it. I have figured it out. It was a mistake in my code.&lt;/P&gt;&lt;P&gt;Again, thank you for all your helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yihong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 15:15:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213626#M16046</guid>
      <dc:creator>yhz</dc:creator>
      <dc:date>2015-06-09T15:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Tasks for SAS EG - Connecting to Unix Server with COM protocol</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213627#M16047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yihong, from your previous message it sounds like you have it all figured out.&amp;nbsp; Good job!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 15:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Custom-Tasks-for-SAS-EG-Connecting-to-Unix-Server-with-COM/m-p/213627#M16047</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-06-09T15:38:11Z</dc:date>
    </item>
  </channel>
</rss>

