<?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 X command accessing work data set in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/X-command-accessing-work-data-set/m-p/163904#M42489</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a 3rd party tool that can export data into any format I want.&amp;nbsp; I'm trying to use the x command statement to execute this process.&amp;nbsp; The issue i'm having is that the data set is part of my sas session and does not exist on the local computer.&amp;nbsp; Can I pass this data set to this process through x command or do I have to save off the data set then access the data through the x command statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options noxwait ;&lt;/P&gt;&lt;P&gt;x 'C:\PROGRA~1\DataTrans\dt.exe work.temp&amp;nbsp; c:\temp\temp.xlsx';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jul 2014 15:46:08 GMT</pubDate>
    <dc:creator>jerry898969</dc:creator>
    <dc:date>2014-07-02T15:46:08Z</dc:date>
    <item>
      <title>X command accessing work data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/X-command-accessing-work-data-set/m-p/163904#M42489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a 3rd party tool that can export data into any format I want.&amp;nbsp; I'm trying to use the x command statement to execute this process.&amp;nbsp; The issue i'm having is that the data set is part of my sas session and does not exist on the local computer.&amp;nbsp; Can I pass this data set to this process through x command or do I have to save off the data set then access the data through the x command statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options noxwait ;&lt;/P&gt;&lt;P&gt;x 'C:\PROGRA~1\DataTrans\dt.exe work.temp&amp;nbsp; c:\temp\temp.xlsx';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 15:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/X-command-accessing-work-data-set/m-p/163904#M42489</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2014-07-02T15:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: X command accessing work data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/X-command-accessing-work-data-set/m-p/163905#M42490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand your question then no.&amp;nbsp; The X command will run on the computer that SAS is running on.&amp;nbsp; So it can only call programs that are on that computer.&amp;nbsp; Now if this conversion program is on the computer which is running SAS then the X command will be able to run it.&amp;nbsp; You will just need to specify the filenames properly.&lt;/P&gt;&lt;P&gt;I find it best to quote filenames in Windows commands to make sure it doesn't get confused by embedded spaces in file or directory names.&lt;/P&gt;&lt;P&gt;I find it best to use DATA _NULL_ and PIPE to execute commands instead of using the X command.&amp;nbsp; That way the program can pull any error messages and save them in the SAS log instead of having them appear on some terminal window or disappear completely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: navy; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: blue; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; &lt;SPAN style="color: blue; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; cmd $&lt;/SPAN&gt;&lt;SPAN style="color: teal; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;STRONG&gt;400&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&amp;nbsp; cmd=quote(catx(&lt;/SPAN&gt;&lt;SPAN style="color: purple; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;' '&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,quote(&lt;/SPAN&gt;&lt;SPAN style="color: purple; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;"C:\PROGRA~1\DataTrans\dt.exe")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,quote(catx(&lt;/SPAN&gt;&lt;SPAN style="color: purple; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;'\'&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;,pathname(&lt;/SPAN&gt;&lt;SPAN style="color: purple; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;'work'&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: purple; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;'temp.sas7bdat'&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,quote(&lt;/SPAN&gt;&lt;SPAN style="color: purple; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;"c:\temp\temp.xlsx")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; &lt;SPAN style="color: blue; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; x pipe &lt;/SPAN&gt;&lt;SPAN style="color: blue; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;filevar&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;=cmd &lt;/SPAN&gt;&lt;SPAN style="color: blue; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;=eof;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; &lt;SPAN style="color: blue; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt; ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; &lt;SPAN style="color: blue; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;put&lt;/SPAN&gt; &lt;SPAN style="color: blue; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;_infile_&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: navy; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; background-position: initial initial; background-repeat: initial initial;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: white; font-family: 'courier new', courier; background-repeat: initial initial; background-position: initial initial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 16:48:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/X-command-accessing-work-data-set/m-p/163905#M42490</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-02T16:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: X command accessing work data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/X-command-accessing-work-data-set/m-p/163906#M42491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much Tom. Using pathname function on the work library and pointing to the data file was exactly what I needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 17:21:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/X-command-accessing-work-data-set/m-p/163906#M42491</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2014-07-02T17:21:31Z</dc:date>
    </item>
  </channel>
</rss>

