<?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: SAS conversion tool in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330319#M74065</link>
    <description>This issue have been raised several times on the community, try a search.&lt;BR /&gt;I recall that since this is standard file format for clinical trial data the xpt format is kinda public and there are probably some 3rd party conversion tools out there.</description>
    <pubDate>Mon, 06 Feb 2017 21:13:48 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2017-02-06T21:13:48Z</dc:date>
    <item>
      <title>SAS conversion tool</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330292#M74046</link>
      <description>&lt;P&gt;We have a third party client that would like SAS data files.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are web developers and would like to find a software package that can convert a .CSV file to a .XPT file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does any such software exist?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 19:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330292#M74046</guid>
      <dc:creator>mmccarver</dc:creator>
      <dc:date>2017-02-06T19:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS conversion tool</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330300#M74052</link>
      <description>&lt;P&gt;Yes, SAS but I suspect that is not the answer you want. The XPT format is designed for moving SAS data between SAS sites running different operating systems and / or SAS versions. It isn't designed for when the provider or receiver doesn't have SAS at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why can't they accept CSV files?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 20:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330300#M74052</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-02-06T20:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS conversion tool</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330310#M74059</link>
      <description>&lt;P&gt;You might see if you can find a version of DBMS Copy. We used to use that for file conversion to SAS from a number of file formats.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure about&amp;nbsp; XPT as output but I'd be surprised if it isn't there.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 20:47:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330310#M74059</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-02-06T20:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS conversion tool</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330319#M74065</link>
      <description>This issue have been raised several times on the community, try a search.&lt;BR /&gt;I recall that since this is standard file format for clinical trial data the xpt format is kinda public and there are probably some 3rd party conversion tools out there.</description>
      <pubDate>Mon, 06 Feb 2017 21:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330319#M74065</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-02-06T21:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS conversion tool</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330323#M74067</link>
      <description>&lt;P&gt;StatTransfer is a commonly referenced tool and likely the cheapest option. Other options are a SAS license, talk to SAS regarding costs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.stattransfer.com/downloads/windows_mac_linux_downloads.html" target="_blank"&gt;https://www.stattransfer.com/downloads/windows_mac_linux_downloads.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 21:41:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330323#M74067</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-06T21:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS conversion tool</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330332#M74072</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SAS conversion tool

You should be able to cut and paste this code into the
SAS IML/R interface

inspired by
https://goo.gl/RGB2KK
https://communities.sas.com/t5/Base-SAS-Programming/SAS-conversion-tool/m-p/330292

Here is a pure R solution. Should also be possible
in Python or Perl.

WORKS BEST WITH THE 1980 SAS Old text editor


HAVE d:/csv/class.csv
======================

NAME,SEX,AGE,HEIGHT,WEIGHT
Alfred,M,14,69,112.5
Alice,F,13,56.5,84
Barbara,F,13,65.3,98
Carol,F,14,62.8,102.5
Henry,M,14,63.5,102.5
James,M,12,57.3,83
Jane,F,12,59.8,84.5
Janet,F,15,62.5,112.5
Jeffrey,M,13,62.5,84
John,M,12,59,99.5
Joyce,F,11,51.3,50.5
Judy,F,14,64.3,90
Louise,F,12,56.3,77
Mary,F,15,66.5,112
Philip,M,16,72,150
Robert,M,12,64.8,128
Ronald,M,15,67,133
Thomas,M,11,57.5,85
William,M,15,66.5,112

WANT   d:/xpt/class.xpt  (V5 export format)
====

WORKING CODE
============

 R  class  &amp;lt;-import("d:/csv/class.csv");
    write.xport( class, file = "d:/xpt/class.xpt" );

FULL SOLUTION
=============

* create comma separated file;
dm "dexport sashelp.class 'd:/csv/class.csv' replace";

%utl_submit_r64('
source("c:/Program Files/R/R-3.3.2/etc/Rprofile.site",echo=T);
library(SASxport);
library(rio);
class  &amp;lt;-import("d:/csv/class.csv");
write.xport( class, file = "d:/xpt/class.xpt" );
');

libname xpt xport "d:/xpt/class.xpt";
data classxpt;
   set xpt.class;
run;quit;

proc print data=classxpt width=min;
title "from SAS proc print";
run;quit;

* check the xpt file;
247   libname xpt xport "d:/xpt/class.xpt";
NOTE: Libref XPT was successfully assigned as follows:
      Engine:        XPORT
      Physical Name: d:\xpt\class.xpt
248   data classxpt;
249      set xpt.class;
250   run;

NOTE: There were 19 observations read from the data set XPT.CLASS.
NOTE: The data set WORK.CLASSXPT has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


250 !     quit;
251   proc print data=classxpt width=min;
252   title "from SAS proc print";
253   run;

NOTE: There were 19 observations read from the data set WORK.CLASSXPT.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.06 seconds
      cpu time            0.04 seconds

253 !     quit;
&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Feb 2017 22:09:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330332#M74072</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-02-06T22:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS conversion tool</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330342#M74081</link>
      <description>&lt;P&gt;Summary of&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42345"&gt;@rogerjdeangelis&lt;/a&gt;&amp;nbsp;code, there's an R package that's available,&amp;nbsp;&lt;A href="https://cran.r-project.org/web/packages/SASxport/SASxport.pdf" target="_blank"&gt;https://cran.r-project.org/web/packages/SASxport/SASxport.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have recollections of seeing issues with this package on StackOverflow so I would suggest searching to see how reliable this is, in addition to your own testing of course.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 22:19:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330342#M74081</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-06T22:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: SAS conversion tool</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330362#M74094</link>
      <description>&lt;P&gt;For the current documentation for the R package SASxport see&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://cran.r-project.org/web/packages/SASxport/SASxport.pdf" target="_blank"&gt;https://cran.r-project.org/web/packages/SASxport/SASxport.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For bugs see&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/MangoTheCat/SASxport/issues" target="_blank"&gt;https://github.com/MangoTheCat/SASxport/issues&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are two outstanding issues.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note R, Python and Perl can read sas7bdats&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WPS and SAS can create SAS datasets from R dataframes.&lt;/P&gt;&lt;P&gt;The express verison of WPS does not limit the size of SAS datasets created from R.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Evan Miller and Hadley Wickham have an experimnetal R package that can create SAS datasets.&lt;/P&gt;&lt;P&gt;However it has acknowledged bugs which are documented and under development.&lt;/P&gt;&lt;P&gt;It is not usable yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think Matt Shotwell is working on a Java API to SAS datasets?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used StatTransfer and it works well. There is also Carolina software, which uses JDBC? I have not used it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 23:47:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-conversion-tool/m-p/330362#M74094</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-02-06T23:47:45Z</dc:date>
    </item>
  </channel>
</rss>

