由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 求助:SAS data set输出
相关主题
一个sas base问题不明白,请教SAS文件读入的问题
How to get summary statistics from multiple imputed data sets怎样在R里读入一个列数超过256列的csv,excel文件?
[合集] 用SAS or SUDAAN处理人口统计数据的问题求答疑(SAS问题)。
真心请教: data cleaning请教SAS 问题
如何计算imputed data set的mean的confidence intervalSAS新手问一个做很多次比较的问题
帮朋友post一个SAS问题,求高人指点。多谢各位了![合集] 如何用SAS把几个colume的值连接在一起
How to check LOST CARD in SAS log[合集] 请教:SAS help
How to work on this dataset?如何将SAS DATA中的变量名改名(不知道原变量名的前提下)
相关话题的讨论汇总
话题: sas话题: documents话题: txt话题: file话题: user
进入Statistics版参与讨论
1 (共1页)
y****1
发帖数: 400
1
我已经纠缠于这个问题有1个多星期了。是这样的:我现在在做基因方面的数据,因为
数据集的格式跟我需要的
不一样于是就读入到SAS中去转。我现在已经转好了,只要输出成.txt文本文档就可以
用了。但是问题是我虽
然只有24个observation(就是24个人),但是有将近2万个column(每个column都是这
个人某条染色体
上面的基因型)。我用命令:
data _null_;
set Imp.pedfile;
file '...';
put Family_ID Individual_ID Father_ID Mother_ID Sex Col1-Col16179;
run;
输出数据的时候虽然只有24行读入,输出就有7000多行了。这样就不行了因为中间一定
被SAS换了行,文件格
式就不对了。
大家能给我一些意见吗?有没有什么强制命令让SAS不能换行?觉得自己已经so close
到最后一步了,只差这
一点儿。老板一直催。
多谢!
l*******l
发帖数: 204
2
Are you sure there are 7000+ lines? open the txt file with web browser to
double check.
p********a
发帖数: 5352
3
SAS didn't go to the next line. It is just your software. Try to use
UltraEdit
to check

【在 y****1 的大作中提到】
: 我已经纠缠于这个问题有1个多星期了。是这样的:我现在在做基因方面的数据,因为
: 数据集的格式跟我需要的
: 不一样于是就读入到SAS中去转。我现在已经转好了,只要输出成.txt文本文档就可以
: 用了。但是问题是我虽
: 然只有24个observation(就是24个人),但是有将近2万个column(每个column都是这
: 个人某条染色体
: 上面的基因型)。我用命令:
: data _null_;
: set Imp.pedfile;
: file '...';

y****1
发帖数: 400
4
对的,有7000多行,是log里面显示的。

【在 l*******l 的大作中提到】
: Are you sure there are 7000+ lines? open the txt file with web browser to
: double check.

y****1
发帖数: 400
5
不是SAS的关系吗?
log里面是这样写的:
NOTE: 7704 records were written to the file 'C:\Documents and Settings\User\
My
Documents\Imputation paper\Chr21.ped'.
The minimum record length was 3.
The maximum record length was 256.
NOTE: There were 24 observations read from the data set IMP.PEDFILE.
所以是输入24行但是输出7704个record

【在 p********a 的大作中提到】
: SAS didn't go to the next line. It is just your software. Try to use
: UltraEdit
: to check

l***a
发帖数: 12410
6
how does this work if you want txt file
proc export data='' outfile='...txt' dbms=csv

User\

【在 y****1 的大作中提到】
: 不是SAS的关系吗?
: log里面是这样写的:
: NOTE: 7704 records were written to the file 'C:\Documents and Settings\User\
: My
: Documents\Imputation paper\Chr21.ped'.
: The minimum record length was 3.
: The maximum record length was 256.
: NOTE: There were 24 observations read from the data set IMP.PEDFILE.
: 所以是输入24行但是输出7704个record

y****1
发帖数: 400
7
我倒是没有手写code,用上面的菜单栏中File->Export Data试了一下,结果是24行没
错,但是group就
很奇怪,而且每行都不一样(不consistent,比如第一行中它把我第6,7列合在一起了
,但是第二行中就把
我的第5,6列合并到一起,不知道怎么回事)。
我用手写的code run下试试。

【在 l***a 的大作中提到】
: how does this work if you want txt file
: proc export data='' outfile='...txt' dbms=csv
:
: User\

l*******l
发帖数: 204
8
try export or ODS. Please post the whole log file so other may help.

【在 y****1 的大作中提到】
: 我倒是没有手写code,用上面的菜单栏中File->Export Data试了一下,结果是24行没
: 错,但是group就
: 很奇怪,而且每行都不一样(不consistent,比如第一行中它把我第6,7列合在一起了
: ,但是第二行中就把
: 我的第5,6列合并到一起,不知道怎么回事)。
: 我用手写的code run下试试。

y****1
发帖数: 400
9
原来的code重新run了一次,log如下:
259304 data _null_;
259305 set Imp.pedfile;
259306 file 'C:\Documents and Settings\User\My Documents\Imputation
paper\Chr21.ped';
259307 put Family_ID Individual_ID Father_ID Mother_ID Sex Col1-
Col16179;
259308 run;
NOTE: The file 'C:\Documents and Settings\User\My Documents\Imputation
paper\Chr21.ped' is:
File Name=C:\Documents and Settings\User\My Documents\Imputation
paper\Chr21.ped,
RECFM=V,LRECL=256
NOTE: 6072 records were written to th

【在 l*******l 的大作中提到】
: try export or ODS. Please post the whole log file so other may help.
y****1
发帖数: 400
10
新尝试如下:
proc export data=Imp.pedfile outfile='C:\Documents and Settings\User\My
Documents\Imputation paper\Chr21ped.txt' dbms=csv;
run;
这个是work的,可是非常让我不解的是我明明有5+16179=16184列,从第6列开始一直到
最后一列的这
16179列中,每一列都有2个数字(1或2),我成功输入到txt文件中后也是24行,可是
我把第一行粘到word
中word count的时候就只有16383个character了???为什么呢???
我现在非常非常的confuse,我都不知道16383这个数字是怎么来的。难道txt文档每行
的长度有限制?
最后还是多谢大家的关注!

【在 l***a 的大作中提到】
: how does this work if you want txt file
: proc export data='' outfile='...txt' dbms=csv
:
: User\

相关主题
帮朋友post一个SAS问题,求高人指点。多谢各位了!SAS文件读入的问题
How to check LOST CARD in SAS log怎样在R里读入一个列数超过256列的csv,excel文件?
How to work on this dataset?求答疑(SAS问题)。
进入Statistics版参与讨论
l*******l
发帖数: 204
11
glad you solve the problem. I am not sure what your new question is. If 每一
列都有2个数字, you should have 5+2*16179 columns.

【在 y****1 的大作中提到】
: 新尝试如下:
: proc export data=Imp.pedfile outfile='C:\Documents and Settings\User\My
: Documents\Imputation paper\Chr21ped.txt' dbms=csv;
: run;
: 这个是work的,可是非常让我不解的是我明明有5+16179=16184列,从第6列开始一直到
: 最后一列的这
: 16179列中,每一列都有2个数字(1或2),我成功输入到txt文件中后也是24行,可是
: 我把第一行粘到word
: 中word count的时候就只有16383个character了???为什么呢???
: 我现在非常非常的confuse,我都不知道16383这个数字是怎么来的。难道txt文档每行

y****1
发帖数: 400
12
对对,就应该有这么多列5+2*16179。可是我输出之后就只有16383列。这就是我不明
白的地方,就是这个数字是怎么来的我完全没有idea。
ps:16383是我把输出数据集第一行全部粘贴到word里面用word count数出来的。我检
查过好多次了肯定没有错。
所以我就想难道说.txt文档有长度限制?所以导致我文件输出不全?

【在 l*******l 的大作中提到】
: glad you solve the problem. I am not sure what your new question is. If 每一
: 列都有2个数字, you should have 5+2*16179 columns.

l*******l
发帖数: 204
13
missing data?
I do not trust the word for the count.
Another way to check the output file is to compare the last column in the txt with sas data.
y****1
发帖数: 400
14
没有missing data哎,每个column都有2个数字。
不过largetail的suggestion很好。我compare的时候发现SAS根本都没有写全,txt文档
到了后面就全部
都是空格了(就是从16383列之后就再也没有东西了)。
现在不知道怎么办了。不过不错,起码知道问题出在哪里了。
多谢大家!

txt
with sas data.

【在 l*******l 的大作中提到】
: missing data?
: I do not trust the word for the count.
: Another way to check the output file is to compare the last column in the txt with sas data.

l*******l
发帖数: 204
15
my silly method.
Try proc print with ods html or ods csv.
try other software.

【在 y****1 的大作中提到】
: 没有missing data哎,每个column都有2个数字。
: 不过largetail的suggestion很好。我compare的时候发现SAS根本都没有写全,txt文档
: 到了后面就全部
: 都是空格了(就是从16383列之后就再也没有东西了)。
: 现在不知道怎么办了。不过不错,起码知道问题出在哪里了。
: 多谢大家!
:
: txt
: with sas data.

y****1
发帖数: 400
16
我要文本文档的格式所以只能用ods rtf,但是它写到word里面也是有SAS输出的格式的
也不行。
好烦啊,为啥写不全啊!!!
烦死了烦死了。

【在 l*******l 的大作中提到】
: my silly method.
: Try proc print with ods html or ods csv.
: try other software.

l*******l
发帖数: 204
17
output to html, then copy to txt

【在 y****1 的大作中提到】
: 我要文本文档的格式所以只能用ods rtf,但是它写到word里面也是有SAS输出的格式的
: 也不行。
: 好烦啊,为啥写不全啊!!!
: 烦死了烦死了。

y****1
发帖数: 400
18
output到word和html都试过了昨天。
发现原来是SAS的问题,后面它就不再写了。

【在 l*******l 的大作中提到】
: output to html, then copy to txt
l*******l
发帖数: 204
19
try R which is free and good for statistic genetics.
Good luck

【在 y****1 的大作中提到】
: output到word和html都试过了昨天。
: 发现原来是SAS的问题,后面它就不再写了。

y****1
发帖数: 400
20
Thanks for all the help:)

【在 l*******l 的大作中提到】
: try R which is free and good for statistic genetics.
: Good luck

o****o
发帖数: 8077
21
the problem is LRECL=256
use LRECL=65534

【在 y****1 的大作中提到】
: 原来的code重新run了一次,log如下:
: 259304 data _null_;
: 259305 set Imp.pedfile;
: 259306 file 'C:\Documents and Settings\User\My Documents\Imputation
: paper\Chr21.ped';
: 259307 put Family_ID Individual_ID Father_ID Mother_ID Sex Col1-
: Col16179;
: 259308 run;
: NOTE: The file 'C:\Documents and Settings\User\My Documents\Imputation
: paper\Chr21.ped' is:

1 (共1页)
进入Statistics版参与讨论
相关主题
如何将SAS DATA中的变量名改名(不知道原变量名的前提下)如何计算imputed data set的mean的confidence interval
SAS -proc transpose 急问!帮朋友post一个SAS问题,求高人指点。多谢各位了!
SAS problem ask for help!How to check LOST CARD in SAS log
advanced 130 第 71How to work on this dataset?
一个sas base问题不明白,请教SAS文件读入的问题
How to get summary statistics from multiple imputed data sets怎样在R里读入一个列数超过256列的csv,excel文件?
[合集] 用SAS or SUDAAN处理人口统计数据的问题求答疑(SAS问题)。
真心请教: data cleaning请教SAS 问题
相关话题的讨论汇总
话题: sas话题: documents话题: txt话题: file话题: user