Some details about DSD:
1.DSD stands for delimiter-sensitive data.
2. It changes the default delimiter from a blank to a comma.
Delimiter becomes "," ( comma) thats why file is of type csv..
3.If there are two delimiters in a row, it assumes there is a missing value between.
4.If character values are placed in quotes the quotes are stripped from the value.
ok. What if the data is of this type?
1!naveen!21!M
2!mani!45!M
indicating sno, name, age and gender respectively.. What do we do??
We can always use delimiter=" " option..
EX: delimiter="!"; can be used..
More than one delimiter can also be specified..
EX: delimiter="@!,";
This is also valid.
Friday, May 30, 2008
dsd and csv
What does the following code do?
data check;
infile 'c:\datanew\tolearn\input.csv' dsd;
input name $ gender $ Age Height Weight;
run;
Answer:
It converts a comma seperated value file called input to a SAS dataset called check. The variables in the file is name and gender(Character variables), age weight and height(Numeric variables) and stores in a dataset called check.
data creates a dataset.
infile statement is used to specify the filename which is to be converted to a SAS dataset.
input statement specify the variables present in the file.The variables are seperated by a comma.
dsd specifies it is a csv file.
Functions of DSD and proc import similarities are to be dealt tomorrow.
data check;
infile 'c:\datanew\tolearn\input.csv' dsd;
input name $ gender $ Age Height Weight;
run;
Answer:
It converts a comma seperated value file called input to a SAS dataset called check. The variables in the file is name and gender(Character variables), age weight and height(Numeric variables) and stores in a dataset called check.
data
infile statement is used to specify the filename which is to be converted to a SAS dataset.
input statement specify the variables present in the file.The variables are seperated by a comma.
dsd specifies it is a csv file.
Functions of DSD and proc import similarities are to be dealt tomorrow.
Numbers to words in SAS
Let me start. I am learning SAS software now and I am realy impressed with the kind of work it can do. So Let me share some things that is really cool about the software. Since i am also learning it right now, it may be simple. Let me assure you that as days progress, the complexity also will increase.
1.What is the use of this statement?
format total words22.;
The answer is it helps you to convert the numbers to words. For example if you have a variable called total which has the total in numeric. If you have to convert it into words, you can use the above statement. The syntax is
format words22.;
The variable name is not optional.
1.What is the use of this statement?
format total words22.;
The answer is it helps you to convert the numbers to words. For example if you have a variable called total which has the total in numeric. If you have to convert it into words, you can use the above statement. The syntax is
format
The variable name is not optional.
Subscribe to:
Posts (Atom)