<?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: Can I skip the ExportDatasetToR step when calling a SAS dataset using R codes? in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/518206#M4467</link>
    <description>&lt;P&gt;I think I might know the problem that you are reporting. The ExportDataSetToR function uses &lt;A href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/readBin.html" target="_self"&gt;the R function 'writeBin&lt;/A&gt;'. The R documentation for writeBin&amp;nbsp;contains this sentence: "readBin and writeBin read and write C-style zero-terminated character strings. &lt;FONT color="#FF0000"&gt;Input strings are limited to 10000 characters.&lt;/FONT&gt;"&amp;nbsp; So if your SAS variable is a character variable whose length is 10,000 or more, you will not be able to transfer it to R from SAS by using the ExportDataSetToR function.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Dec 2018 19:38:28 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2018-12-03T19:38:28Z</dc:date>
    <item>
      <title>Can I skip the ExportDatasetToR step when calling a SAS dataset using R codes?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/517843#M4462</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to R and have been trying out how to integrate R codes in SAS.&lt;/P&gt;&lt;P&gt;In&amp;nbsp;a single SAS program, I have some SAS codes followed by R codes.&lt;/P&gt;&lt;P&gt;Can I call on the SAS datasets (mydataset1 mydataset2) without doing the ExportDataSetToR step?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason why I'm asking is there seemed to be some limit on the length of the variables in the dataset when doing the ExportDataSetToR step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydataset1;
set mylibrary.mydataset1;
run;
&lt;BR /&gt;data mydataset2;&lt;BR /&gt;set mylibrary.mydataset2;&lt;BR /&gt;run;&lt;BR /&gt;
proc iml;

run ExportDataSetToR("mydataset1", "rdataset1");&lt;BR /&gt;run ExportDataSetToR("mydataset2", "rdataset2");

submit / R;

#_______Begin of R code_________________

total &amp;lt;- merge(data mydataset1, data mydataset2, by="ID")

#_______End of R code_________________

endsubmit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 08:54:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/517843#M4462</guid>
      <dc:creator>JJIN</dc:creator>
      <dc:date>2018-12-02T08:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can I skip the ExportDatasetToR step when calling a SAS dataset using R codes?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/517849#M4463</link>
      <description>&lt;P&gt;The&amp;nbsp;ExportDataSetToR subroutine creates an R data frame from data in a SAS data set. It also converts some variable&amp;nbsp;representations (dates, times, missing values,...) into the analogous R representations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To answer your question, you are not&amp;nbsp;required to use the&amp;nbsp;&lt;SPAN&gt;ExportDataSetToR subroutine, but I think it is the most reliable and efficient way to form an R data frame from SAS data. If you prefer to import the data some other way (an R package, converting to CSV,...) then you can do so. However, I can't think of an example in which I would recommend that approach.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 11:42:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/517849#M4463</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-12-02T11:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I skip the ExportDatasetToR step when calling a SAS dataset using R codes?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/517854#M4464</link>
      <description>Thanks. I am having issues with ExportDataSetToR as the length of one of the string variable is very long (address).</description>
      <pubDate>Sun, 02 Dec 2018 13:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/517854#M4464</guid>
      <dc:creator>JJIN</dc:creator>
      <dc:date>2018-12-02T13:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can I skip the ExportDatasetToR step when calling a SAS dataset using R codes?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/517906#M4465</link>
      <description>&lt;P&gt;If you provide details and an example, someone might be able to help.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 20:30:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/517906#M4465</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-12-02T20:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can I skip the ExportDatasetToR step when calling a SAS dataset using R codes?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/518206#M4467</link>
      <description>&lt;P&gt;I think I might know the problem that you are reporting. The ExportDataSetToR function uses &lt;A href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/readBin.html" target="_self"&gt;the R function 'writeBin&lt;/A&gt;'. The R documentation for writeBin&amp;nbsp;contains this sentence: "readBin and writeBin read and write C-style zero-terminated character strings. &lt;FONT color="#FF0000"&gt;Input strings are limited to 10000 characters.&lt;/FONT&gt;"&amp;nbsp; So if your SAS variable is a character variable whose length is 10,000 or more, you will not be able to transfer it to R from SAS by using the ExportDataSetToR function.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 19:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/518206#M4467</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-12-03T19:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can I skip the ExportDatasetToR step when calling a SAS dataset using R codes?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/518207#M4468</link>
      <description>&lt;P&gt;I think I might know the problem that you are reporting. The ExportDataSetToR function uses &lt;A href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/readBin.html" target="_self"&gt;the R function 'writeBin&lt;/A&gt;'. The R documentation for writeBin&amp;nbsp;contains this sentence: "readBin and writeBin read and write C-style zero-terminated character strings. &lt;FONT color="#FF0000"&gt;Input strings are limited to 10000 characters.&lt;/FONT&gt;"&amp;nbsp; So if your SAS variable is a character variable whose length is 10,000 or more, you will not be able to transfer it to R from SAS by using the ExportDataSetToR function.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 19:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Can-I-skip-the-ExportDatasetToR-step-when-calling-a-SAS-dataset/m-p/518207#M4468</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-12-03T19:38:28Z</dc:date>
    </item>
  </channel>
</rss>

