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



In SAS how to read the variable values having different formats. eg:mar99,mar1999 (in a single va..

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

In SAS how to read the variable values having different formats. eg:mar99,mar1999 (in a single va..

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

In SAS how to read the variable values having different formats. eg:mar99,mar1999 (in a single va..

Answer / ok

In SAS v9 you can try the ANYDTDTEw. Informat

Is This Answer Correct ?    7 Yes 1 No

In SAS how to read the variable values having different formats. eg:mar99,mar1999 (in a single va..

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

In SAS how to read the variable values having different formats. eg:mar99,mar1999 (in a single va..

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

In SAS how to read the variable values having different formats. eg:mar99,mar1999 (in a single va..

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

In SAS how to read the variable values having different formats. eg:mar99,mar1999 (in a single va..

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

In SAS how to read the variable values having different formats. eg:mar99,mar1999 (in a single va..

Answer / ravi_kumar

anydtdtew.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SAS Interview Questions

How are the analysis data sets structured?

3 Answers  


what is the difference between the SAS v8 and SAS v9?

7 Answers   TCS,


Which is Best Institute for learning SAS BASE & SAS BI in Hyderabad? Can anyone suggest me ?

5 Answers   ACC,


PROC SQL always ends with QUIT statement.Why cant you use RUN in PROQ SQL ?

7 Answers   HP,


What is slibref?

0 Answers  






Mention the validation tools used in SAS?

0 Answers  


Can you excute a macro within a macro? Describe.

3 Answers  


what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake

0 Answers   Blue Star,


How do you add a number to a macro variable?

3 Answers  


Do you think professionally?

1 Answers   Oracle,


What is criteria for adverse events and treatment-emergent adverse events?

2 Answers   Accenture,


what type of reports you are generating in your company...???

2 Answers   GSK GlaxoSmithKline,


Categories