Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在.xpt文件中存储数据集_C#_.net_Sas - Fatal编程技术网

C# 在.xpt文件中存储数据集

C# 在.xpt文件中存储数据集,c#,.net,sas,C#,.net,Sas,我试图找出如何将从SQL server检索到的数据存储到.xpt文件中 有谁能帮我用C#?来做这件事吗.xpt文件扩展名通常用于Proc CPORT创建的文件。这些文件包含SAS传输格式的数据,可通过在其他SAS安装中运行的Proc CIMPORTcode读回 示例代码 * transport a data set; proc cport data=sashelp.class file='%temp%\class.xpt'; run; * transport the results of a

我试图找出如何将从SQL server检索到的数据存储到
.xpt
文件中


有谁能帮我用C#?

来做这件事吗
.xpt
文件扩展名通常用于
Proc CPORT
创建的文件。这些文件包含SAS传输格式的数据,可通过在其他SAS安装中运行的
Proc CIMPORT
code读回

示例代码

* transport a data set;
proc cport data=sashelp.class file='%temp%\class.xpt';
run;

* transport the results of a query;
proc sql;
  create view for_transport as
  select * from sashelp.class
  ;

proc cport data=work.for_transport file='%temp%\myquery_resultset.xpt';
run;

时间和金钱最好花在将需求更改为“create.xml”文件而不是“create.xpt”文件上

  • .XPT
    文件将由SAS会话读取
  • 没有用于创建.XPT的C#库
  • 您必须破译.XPT并测试您自己的.XPT编写器
  • SAS会话还可以读取.XML文件
  • SQL Server具有超级方便的
    FOR XML
    子句,用于创建XML输出 直接地
  • 非常容易从C执行SQL server代码#
  • 客户端获取.xml文件,该文件可以很容易地读入其SAS系统

假设XPT指的是SAS V5传输文件,则有一个C库用于读取(和写入)多种统计格式,包括SAS的XPORT格式


不确定它是否与C兼容

感谢@Addison.XPT用于Mozilla Firefox组件?客户端的要求是将数据库表存储在XPT文件中XPT是一种专有的SAS格式,而且目前还没有这样的库。您是否有权访问SAS并希望从C#执行正确的SAS命令?