p*****o 发帖数: 543 | 1 in my txt file, the delimitor is comma, and field enclosed in double quotes.
eg:
"Jack, Liu", "Lucy, Li", ...
when I imported into sas, I know how to use delimiter = ',', but how can i
handle the comma the double quotes? What option should I use for it?
Thanks a lot | k*******a 发帖数: 772 | | p*****o 发帖数: 543 | 3 i only saw dsd before......
so would you mind telling me how to use it?
INFILE "test.txt" DLM=',' DSD MISSOVER FIRSTOBS=2 sds='"'---is it right?
【在 k*******a 的大作中提到】 : sds
| k*******a 发帖数: 772 | 4 sorry, it's DSD, my bad memory :(
Maybe you also need to define the length for the variable of name (the
defaul length is only 8)
【在 p*****o 的大作中提到】 : i only saw dsd before...... : so would you mind telling me how to use it? : INFILE "test.txt" DLM=',' DSD MISSOVER FIRSTOBS=2 sds='"'---is it right?
| Y**********8 发帖数: 67 | 5 DSD does two things:
1) sets commma the default delimiter (so you don't need the delimiter option)
2) removes quotation marks from values (so the quotation marks will be
removed from the values, and comma in the quotation marks will appear as
part of the values )
you may need the length statement before the input statement
correct me if I am wrong
quotes.
【在 p*****o 的大作中提到】 : in my txt file, the delimitor is comma, and field enclosed in double quotes. : eg: : "Jack, Liu", "Lucy, Li", ... : when I imported into sas, I know how to use delimiter = ',', but how can i : handle the comma the double quotes? What option should I use for it? : Thanks a lot
| p*****o 发帖数: 543 | 6 Great. Thanks all.
BTW, I tried using length and without lenght, I guess both work since each
variable in my data has uniform length.
one more question, if i want to use length option, for "Liu, Lili", should I
definied as at least 9 or 9+2?
Thanks!
option)
【在 Y**********8 的大作中提到】 : DSD does two things: : 1) sets commma the default delimiter (so you don't need the delimiter option) : 2) removes quotation marks from values (so the quotation marks will be : removed from the values, and comma in the quotation marks will appear as : part of the values ) : you may need the length statement before the input statement : correct me if I am wrong : : quotes.
| p*****o 发帖数: 543 | 7 btw, i thought dsd also treated nothing btw two comma as a missing value?
option)
【在 Y**********8 的大作中提到】 : DSD does two things: : 1) sets commma the default delimiter (so you don't need the delimiter option) : 2) removes quotation marks from values (so the quotation marks will be : removed from the values, and comma in the quotation marks will appear as : part of the values ) : you may need the length statement before the input statement : correct me if I am wrong : : quotes.
|
|