<?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 CALL SYSTEM doesn't work as I expect... in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/CALL-SYSTEM-doesn-t-work-as-I-expect/m-p/68241#M19540</link>
    <description>Hi, I ran this code to remotely connect to a server in order to download data and zip it before downloading it to a local PC using SSH File Transfer, but it doesn't give me what I wanted.&lt;BR /&gt;
&lt;BR /&gt;
%let....&lt;BR /&gt;
options comamid=....&lt;BR /&gt;
signon username=_prompt_;&lt;BR /&gt;
rsubmit;&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
call system('mkdir /temp/myname);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
libname mydata '/temp/myname';&lt;BR /&gt;
&lt;BR /&gt;
data mydata.something; /*collect data &amp;amp; put it in my directory created above*/&lt;BR /&gt;
set datasource;&lt;BR /&gt;
/*codes here*/&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;/*Things go wrong here*/&lt;/B&gt;&lt;BR /&gt;
data _null_; /*compress data just collected and put it in same directory*/&lt;BR /&gt;
call system('gzip /temp/myname/something');&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
After logging in SSH and checking the directory "myname", I saw the file "something" BUT IT IS NOT ZIPPED! The GZIP command wasn't executed in the last SAS codes above. Why so?&lt;BR /&gt;
&lt;BR /&gt;
Can anyone please help? Thanks a lot</description>
    <pubDate>Sun, 22 May 2011 05:37:08 GMT</pubDate>
    <dc:creator>smilingmelbourne</dc:creator>
    <dc:date>2011-05-22T05:37:08Z</dc:date>
    <item>
      <title>CALL SYSTEM doesn't work as I expect...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/CALL-SYSTEM-doesn-t-work-as-I-expect/m-p/68241#M19540</link>
      <description>Hi, I ran this code to remotely connect to a server in order to download data and zip it before downloading it to a local PC using SSH File Transfer, but it doesn't give me what I wanted.&lt;BR /&gt;
&lt;BR /&gt;
%let....&lt;BR /&gt;
options comamid=....&lt;BR /&gt;
signon username=_prompt_;&lt;BR /&gt;
rsubmit;&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
call system('mkdir /temp/myname);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
libname mydata '/temp/myname';&lt;BR /&gt;
&lt;BR /&gt;
data mydata.something; /*collect data &amp;amp; put it in my directory created above*/&lt;BR /&gt;
set datasource;&lt;BR /&gt;
/*codes here*/&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;/*Things go wrong here*/&lt;/B&gt;&lt;BR /&gt;
data _null_; /*compress data just collected and put it in same directory*/&lt;BR /&gt;
call system('gzip /temp/myname/something');&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
After logging in SSH and checking the directory "myname", I saw the file "something" BUT IT IS NOT ZIPPED! The GZIP command wasn't executed in the last SAS codes above. Why so?&lt;BR /&gt;
&lt;BR /&gt;
Can anyone please help? Thanks a lot</description>
      <pubDate>Sun, 22 May 2011 05:37:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/CALL-SYSTEM-doesn-t-work-as-I-expect/m-p/68241#M19540</guid>
      <dc:creator>smilingmelbourne</dc:creator>
      <dc:date>2011-05-22T05:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYSTEM doesn't work as I expect...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/CALL-SYSTEM-doesn-t-work-as-I-expect/m-p/68242#M19541</link>
      <description>Hi &lt;BR /&gt;
If the code you've posted is 1:1 the code you've run with issues then one of the reasons might be that there is a quote missing.&lt;BR /&gt;
&lt;BR /&gt;
call system('mkdir /temp/myname); ... there should be a quote after .../myname&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
What I normally do with OS commands: I first try them in a command prompt before I use them in SAS. In your example you could issue the gzip command first in a putty session and see if it works from there.&lt;BR /&gt;
&lt;BR /&gt;
Else: What does the SAS log tell you?&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Sun, 22 May 2011 13:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/CALL-SYSTEM-doesn-t-work-as-I-expect/m-p/68242#M19541</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-05-22T13:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYSTEM doesn't work as I expect...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/CALL-SYSTEM-doesn-t-work-as-I-expect/m-p/68243#M19542</link>
      <description>Hi Pattrick, I missed the quote in the codes posted here, but in the original SAS program I have both quotes in the argument to the Call System function.&lt;BR /&gt;
&lt;BR /&gt;
I've tried the GZIP command in both SSH Secure Shell Client and Putty and it works perfectly. The file is zipped. &lt;BR /&gt;
&lt;BR /&gt;
The SAS log doesn't say anything about errors. Right below the codes that has the Call System, I saw a few lines like:&lt;BR /&gt;
&lt;BR /&gt;
"Data statement used (Total process time):&lt;BR /&gt;
real time 0.17 seconds&lt;BR /&gt;
cpu time 0.01 seconds"&lt;BR /&gt;
&lt;BR /&gt;
However, when I logged in SSH I saw data set but it wasn't compressed, meaning the GZIP function wasn't executed.&lt;BR /&gt;
&lt;BR /&gt;
Thanks a lot for help&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: smilingmelbourne

Message was edited by: smilingmelbourne</description>
      <pubDate>Sun, 22 May 2011 23:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/CALL-SYSTEM-doesn-t-work-as-I-expect/m-p/68243#M19542</guid>
      <dc:creator>smilingmelbourne</dc:creator>
      <dc:date>2011-05-22T23:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYSTEM doesn't work as I expect...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/CALL-SYSTEM-doesn-t-work-as-I-expect/m-p/68244#M19543</link>
      <description>I missed the file extension for the SAS dataset, so I didn't work. It should have been........&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
call system('gzip /temp/myname/something.&lt;B&gt;sas7bdat&lt;/B&gt;'); /*Add file extension "sas7bdat and it works"*/&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 23 May 2011 03:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/CALL-SYSTEM-doesn-t-work-as-I-expect/m-p/68244#M19543</guid>
      <dc:creator>smilingmelbourne</dc:creator>
      <dc:date>2011-05-23T03:05:34Z</dc:date>
    </item>
  </channel>
</rss>

