<?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 Connecting to UNIX in a macro with &amp;quot;x&amp;quot; command in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/303989#M20615</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to Unzip some files in a location connected to UNIX.&lt;/P&gt;&lt;P&gt;However there are several to Unzip and I thought it will be easier to code using a macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I am not sure how to alter the "x" command or use the following statement in the macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x "gunzip /sas/data/...."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would anyone have any ideas of how to implement this code in the macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Oct 2016 09:47:13 GMT</pubDate>
    <dc:creator>PriyaL</dc:creator>
    <dc:date>2016-10-12T09:47:13Z</dc:date>
    <item>
      <title>Connecting to UNIX in a macro with "x" command</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/303989#M20615</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to Unzip some files in a location connected to UNIX.&lt;/P&gt;&lt;P&gt;However there are several to Unzip and I thought it will be easier to code using a macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I am not sure how to alter the "x" command or use the following statement in the macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x "gunzip /sas/data/...."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would anyone have any ideas of how to implement this code in the macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 09:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/303989#M20615</guid>
      <dc:creator>PriyaL</dc:creator>
      <dc:date>2016-10-12T09:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to UNIX in a macro with "x" command</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/303991#M20616</link>
      <description>&lt;P&gt;EG typically doesn't allow for X commands unless you've overridden the default settings.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whats the parameter for your macro? The filenames? Or will you automatically scan a folder for zip files and unzip them all?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before writing a macro first get base code working. Then determine your parameters, and then convert.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 10:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/303991#M20616</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-12T10:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to UNIX in a macro with "x" command</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/303997#M20617</link>
      <description>&lt;P&gt;First of all, gunzip accepts a list of files on the commandline. Therefore you can use wildcard characters to name a group or groups of files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, you need to have the XCMD system option enabled at startup; there is an option for that in the metadata of workspace servers. You cannot change this option during SAS runtime.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Third, you can run your gunzip command repeatedly from a dataset containing filenames with call system(). No need for a macro, unless you want to automate that (parameterized filename patterns, directories).&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 10:15:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/303997#M20617</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-10-12T10:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to UNIX in a macro with "x" command</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/304130#M20623</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If you have IML Studio then you should have a bridge to R you can then do the following

    library(R.utils);                                                                                                                                                 
    wd&amp;lt;-getwd();                                                                                                                                                      
    setwd("c:\\temp");                                                                                                                                                
    gunzip("class.sas7bdat.gz",remove=FALSE,overwrite=TRUE);                                                                                                          
    setwd(wd);    

Note gunzip removes the gz file and creates c:/temp/class.sas7bdat         &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Oct 2016 15:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/304130#M20623</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2016-10-12T15:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to UNIX in a macro with "x" command</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/304136#M20624</link>
      <description>&lt;P&gt;You can call the X command in a macro the same way you would call it outside of a macro.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro gunzip(filename);
x "gunzip &amp;amp;filename" ;
%mend gunzip;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I find it is usually better to use a pipe to run commands since you can then capture any responses the command might make.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro gunzip(filename);
data _null_;
  infile "gunzip &amp;amp;filename" pipe;
  input;
  put _infile_;
run;
%mend gunzip;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Oct 2016 15:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/304136#M20624</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-10-12T15:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to UNIX in a macro with "x" command</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/304158#M20626</link>
      <description>Curious if the IML bridge to R works with NOXCMD</description>
      <pubDate>Wed, 12 Oct 2016 17:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/304158#M20626</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2016-10-12T17:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to UNIX in a macro with "x" command</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/304214#M20628</link>
      <description>&lt;P&gt;Have you considered using the Filename ZIP engine? Here how this could work:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/&amp;nbsp;" target="_blank"&gt;http://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 01:17:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Connecting-to-UNIX-in-a-macro-with-quot-x-quot-command/m-p/304214#M20628</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-10-13T01:17:33Z</dc:date>
    </item>
  </channel>
</rss>

