<?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: Exporting The variable value from SAS to UNIX in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Exporting-The-variable-value-from-SAS-to-UNIX/m-p/66062#M14340</link>
    <description>The reason why this is so difficult is because environment variables are inherited by the child process but the parent process is unaffected by the child process.</description>
    <pubDate>Wed, 25 May 2011 19:58:06 GMT</pubDate>
    <dc:creator>Clarke_Thacher</dc:creator>
    <dc:date>2011-05-25T19:58:06Z</dc:date>
    <item>
      <title>Exporting The variable value from SAS to UNIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-The-variable-value-from-SAS-to-UNIX/m-p/66058#M14336</link>
      <description>Dear All,&lt;BR /&gt;
&lt;BR /&gt;
Can you please help me out of this issue. &lt;BR /&gt;
&lt;BR /&gt;
I hacve created sample.sas program, please find the program below.&lt;BR /&gt;
sample.sas  program :&lt;BR /&gt;
&lt;BR /&gt;
data a;&lt;BR /&gt;
input a $5.;&lt;BR /&gt;
datalines;&lt;BR /&gt;
hello&lt;BR /&gt;
howru&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
select a into :id separated by ','  from a ;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
call system('export var="&amp;amp;id."');&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I have created samp.sh program , here i am executing the sample.sas program and print the output from SAS program in UNIX environment. I am not getting the result. &lt;BR /&gt;
&lt;BR /&gt;
*shell Script:&lt;BR /&gt;
samp.sh&lt;BR /&gt;
&lt;BR /&gt;
#!/usr/bin/ksh&lt;BR /&gt;
&lt;BR /&gt;
sas sample.sas&lt;BR /&gt;
&lt;BR /&gt;
echo $var&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Could you please help me out about the above  issue. I have used X command as well.&lt;BR /&gt;
&lt;BR /&gt;
Thanks In Advance.&lt;BR /&gt;
&lt;BR /&gt;
Best Regards</description>
      <pubDate>Mon, 16 May 2011 12:39:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-The-variable-value-from-SAS-to-UNIX/m-p/66058#M14336</guid>
      <dc:creator>Uli</dc:creator>
      <dc:date>2011-05-16T12:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting The variable value from SAS to UNIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-The-variable-value-from-SAS-to-UNIX/m-p/66059#M14337</link>
      <description>might try replacing&lt;BR /&gt;
call system('export var="&amp;amp;id."');&lt;BR /&gt;
with&lt;BR /&gt;
call system("export var=""&amp;amp;id.""");&lt;BR /&gt;
If the shell script command "export" supports single quotes, then  use&lt;BR /&gt;
call system("export var='&amp;amp;id.'");</description>
      <pubDate>Mon, 16 May 2011 18:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-The-variable-value-from-SAS-to-UNIX/m-p/66059#M14337</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-05-16T18:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting The variable value from SAS to UNIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-The-variable-value-from-SAS-to-UNIX/m-p/66060#M14338</link>
      <description>Maybe You can code like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data a;&lt;BR /&gt;
input a $5.;&lt;BR /&gt;
datalines;&lt;BR /&gt;
hello&lt;BR /&gt;
howru&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
 set a end=last;&lt;BR /&gt;
 file '/usr/bin/ksh/samp.sh';&lt;BR /&gt;
 length id $ 500;&lt;BR /&gt;
 retain id;&lt;BR /&gt;
 id=catx(' ',a);&lt;BR /&gt;
 if last then do;&lt;BR /&gt;
              envir_var='export var='||id;&lt;BR /&gt;
              put envir_var;&lt;BR /&gt;
              end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 18 May 2011 01:23:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-The-variable-value-from-SAS-to-UNIX/m-p/66060#M14338</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-05-18T01:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting The variable value from SAS to UNIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-The-variable-value-from-SAS-to-UNIX/m-p/66061#M14339</link>
      <description>Check this SAS Note: &lt;A href="http://support.sas.com/kb/9/089.html" target="_blank"&gt;http://support.sas.com/kb/9/089.html&lt;/A&gt;</description>
      <pubDate>Wed, 18 May 2011 20:00:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-The-variable-value-from-SAS-to-UNIX/m-p/66061#M14339</guid>
      <dc:creator>TimB_SAS</dc:creator>
      <dc:date>2011-05-18T20:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting The variable value from SAS to UNIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-The-variable-value-from-SAS-to-UNIX/m-p/66062#M14340</link>
      <description>The reason why this is so difficult is because environment variables are inherited by the child process but the parent process is unaffected by the child process.</description>
      <pubDate>Wed, 25 May 2011 19:58:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-The-variable-value-from-SAS-to-UNIX/m-p/66062#M14340</guid>
      <dc:creator>Clarke_Thacher</dc:creator>
      <dc:date>2011-05-25T19:58:06Z</dc:date>
    </item>
  </channel>
</rss>

