楼主: jjpanda1111
20741 17

[求助]如何将.sas7bdat转为.dat文件 [推广有奖]

  • 5关注
  • 0粉丝

教授

24%

还不是VIP/贵宾

-

威望
0
论坛币
9014 个
通用积分
170.8330
学术水平
38 点
热心指数
42 点
信用等级
37 点
经验
23751 点
帖子
733
精华
0
在线时间
1494 小时
注册时间
2006-8-4
最后登录
2024-4-27

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
我在用sas时碰到了一个.sas7bdat数据文件,发现用sas打开时,该文件自动就在work数据库中了,我想将其转为.dat文件,该怎么做呢。压缩文件中的是tobitex.sas7bdat 。 213824.rar (1.89 KB) 本附件包括:
  • tobitex.sas7bdat
<br/>

[此贴子已经被作者于2008-5-20 23:30:31编辑过]

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:sas7bdat dat文件 BDA Tobit 压缩文件 dat文件 压缩文件 数据库 如何

沙发
eblog 发表于 2008-5-19 17:01:00 |只看作者 |坛友微信交流群
使用stata/transfer软件,很简单的

使用道具

藤椅
PharmD 发表于 2008-5-20 03:33:00 |只看作者 |坛友微信交流群
File -> Export data -> do as directed -> next -> select "Delimited File (*.*)" in the pull-down menu under "Standard Data Source" -> next -> do as directed, the extension name of the exported file should be .dat -> next/finish

使用道具

板凳
jjpanda1111 发表于 2008-5-20 10:51:00 |只看作者 |坛友微信交流群
谢谢楼上同学的帮助!请问用程序实现可不可以,我的数据中变量名有空格,无法正常输出,该怎么办。

[此贴子已经被作者于2008-5-20 11:17:03编辑过]

使用道具

报纸
PharmD 发表于 2008-5-20 17:31:00 |只看作者 |坛友微信交流群
<div class="quote"><b>以下是引用<i>jjpanda1111</i>在2008-5-20 10:51:00的发言:</b><br/>谢谢楼上同学的帮助!请问用程序实现可不可以,我的数据中变量名有空格,无法正常输出,该怎么办。<br/></div><p>1. Yes. PROC EXPORT.</p><p>2. I did not know that was allowed in .sas7bdat files... Could you please give us an example?</p>

使用道具

地板
wxq1638 发表于 2008-5-20 18:38:00 |只看作者 |坛友微信交流群

搓一把试试

213753.rar (157.76 KB) 本附件包括:
  • 首先.doc
<br/>

使用道具

7
lwien007 发表于 2008-5-20 20:28:00 |只看作者 |坛友微信交流群
proc export data=c<br/>&nbsp;outfile='d:\ts.dat'<br/>&nbsp;dbms=dlm replace;<br/>run;

使用道具

8
lwien007 发表于 2008-5-20 20:36:00 |只看作者 |坛友微信交流群
<p>变量名有空格??</p><p>sas中变量名可以有空格么??</p>

使用道具

9
jjpanda1111 发表于 2008-5-20 23:27:00 |只看作者 |坛友微信交流群
<p>我是用sas直接打开.sas7bdat文件,然后就自动创建了一个名为temp1的库,库里只有tobitex一个数据集,然后就看到数据,以下是数据的一部分:ID APT READ SCORE MATH SCORE PUBLIC<br/>1&nbsp; 558&nbsp;&nbsp;&nbsp; 34&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 40&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br/>2&nbsp; 525&nbsp;&nbsp;&nbsp; 39&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 33&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br/>3&nbsp; 800&nbsp;&nbsp;&nbsp; 63&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br/>我用infile,input语句想将数据读出,然后用proc print 输出看看,结果全都是"."这样的missing value,其实我是想将tobitex.sas7bdat中的数据能否直接打开,并能装入到一个永久库中。其中,read score和math score两个变量名好像有空格存在,不知道是不是这个原因无法输出。</p><p><font color="#2b4dd5">我将tobitex.sas7bdat放在压缩文件中了。</font>谢谢各位的帮助!<br/></p>

[此贴子已经被作者于2008-5-20 23:30:49编辑过]

使用道具

10
PharmD 发表于 2008-5-21 06:11:00 |只看作者 |坛友微信交流群
<div class="quote"><b>以下是引用<i>jjpanda1111</i>在2008-5-20 23:27:00的发言:</b><br/><p>我是用sas直接打开.sas7bdat文件,然后就自动创建了一个名为temp1的库,库里只有tobitex一个数据集,然后就看到数据,以下是数据的一部分:ID APT READ SCORE MATH SCORE PUBLIC<br/>1&nbsp; 558&nbsp;&nbsp;&nbsp; 34&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 40&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br/>2&nbsp; 525&nbsp;&nbsp;&nbsp; 39&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 33&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br/>3&nbsp; 800&nbsp;&nbsp;&nbsp; 63&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br/><font color="#ff0000">1. </font>我用infile,input语句想将数据读出,然后用proc print 输出看看,结果全都是"."这样的missing value,<font color="#ff0000">2. </font>其实我是想将tobitex.sas7bdat中的数据能否直接打开,<font color="#ff0000">3.</font> 并能装入到一个永久库中。其中,<font color="#ff0000">4. </font>read score和math score两个变量名好像有空格存在,不知道是不是这个原因无法输出。</p><p><font color="#2b4dd5">我将tobitex.sas7bdat放在压缩文件中了。</font>谢谢各位的帮助!<br/></p><br/></div><p></p><p>1. infile and input statements will NOT work on .sas7bdat files. Go Google "SET" statement in DATA step.</p><p>2. What do you mean by 直接打开?</p><p>3. DATA step will take care of it if you want. I suggest you read the entire "DATA step" under the topic "Base SAS Software" in SAS Help.</p><p>4. Right-click on the column with the caption "math score" and then go to Column Attributies, then&nbsp;you will find out the actual variable name is "MATH". "math score" is only its label.</p><p>Last but not the least important, I feel that you need a good cookbook-style SAS textbook to guide you through these trivial stuff. Judging by the questions you have been posting on this board, the learning materials you are currently using are not of much help - I am not saying your skills are at a low level; we all start like that. But a well-written textbook/reference will&nbsp;help you more than you&nbsp;would ever expect. </p><p>Hope these help. Thanks.</p>

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-28 10:58