In SAS how to read the variable values having different
formats.
eg:mar99,mar1999 (in a single variable)
Answers were Sorted based on User's Feedback
Answer / sankar
data ss;
input name$ s anydtdte9.;
cards;
sankar mar99
mahesh mar1999
run;
proc print data=ss;
format s date9.;
run;
Is This Answer Correct ? | 13 Yes | 2 No |
Answer / poornima
To read the data with mar99 and mar1999, we use eurdfmyw.
informat.
This informat is used to read the data with only month and
year.
eg:
data m;
input n date eurdfmy7.;
format date eurdfmy7.;
cards;
12 mar99
45 mar1999
45 sep98
run;
proc print data=m;
run;
Is This Answer Correct ? | 10 Yes | 3 No |
Answer / chiranjeevi
data code;
input name$ dob monyy7.;
cards;
a mar99
b mar1999
run;
proc print data=code;
format dob monyy7.;
run;
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / shaik
data m;
input n date monyy7.;
format date monyy7.;
cards;
12 mar99
45 mar1999
45 sep98
run;
we will get output;
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / vijay
for the informats/formats in the question i.e. DATEw.
ones.. we can use the above 2 informats
if the data is in MMDDYYYYw. fashion use EURDFDTw.
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / svm
For Date Time check here,
http://www.sfu.ca/sasdoc/sashtml/lrcon/zenid-63.htm
Is This Answer Correct ? | 1 Yes | 0 No |
Mention what are the data types does SAS contain?
How do you add a number to a macro variable?
data study; input Subj : $3. Group : $1. Dose : $4. Weight : $8. Subgroup; x= input(Weight,5.1); datalines; 001 A Low 220 2 002 A High 90 1 003 B Low 193.6 1 004 B High 165 2 005 A Low 123.4 1 ; Why does X get truncated? X shows up as 22 instead of 220,9 instead of 90 and 19.8 instead of 198? This problem doesnt happen with the values 193.6 and 123.4. This does not happen if x is read on the 5. informat instead of the 5.1 informat
How does Mr.Lanka Srinivas teach SAS? Are his accomplishments real? What are the future prospects for SAS?
In the flow of DATA step processing, what is the first action in a typical DATA Step?
Code a PROC SORT on a data set containing State, District and County as the primary variables, along with several numeric variables?
I use NOCUM/NOPERCENT option in the tables statement like this Proc freq data = deepak; tables x y /nocum nopercent; run; Here I get nopercent and nocum in the output only for variables x and y. How do i do it for all variables? Deepak
Describe the ways in which you can create macro variables? : sas-macro
If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable?
what is the use of LRECL option.
If a variable contains only numbers, can it be a character data type?
where to use sas business intelligence? : Sas-bi