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

what is PhaseIII, ODS, TLG, Macro and Proc in SAS

0 Answers  


Difference between informat and format?

0 Answers  


In which format does Date stores in sas..? What is the use of DATE in SAS.?

3 Answers   TCS,


How to get any kind of data in SAS? Is it possible to take data from notepad in SAS?

7 Answers   GSK, TNS,


libname deepak 'C:\SAS Files'; proc format; invalue convert 'A+' = 100 'A' = 96 'A-' = 92 'B+' = 88 'B' = 84 'B-' = 80 'C+' = 76 'C' = 72 'F' = 65; data deepak.grades; input ID $3. Grade convert.; *format Grade convert. ; datalines; 001 A- 002 B+ 003 F 004 C+ 005 A ; proc print data = deepak.grades; run; I get the following output Obs ID Grade 1 001 . 2 002 . 3 003 . 4 004 . 5 005 . I don’t understand why Grade shows up as a missing value. Everything seems fine, including ID $3. Now, in case I use ID : $3. Or use column input, I get the desired output. Kindly help Deepak

7 Answers  


Briefly describe 5 ways to do a "table lookup" in sas.

4 Answers   Quintiles,


what kind of variables are collected in AE dataset?

3 Answers   Accenture, Quintiles, SAS,


what is enterprise guide? What is the use of it? : Sas programming

0 Answers  


Name and describe few sas character functions that are used for data cleaning in brief.

0 Answers  


how to know the attributes of first five datasets in a library

2 Answers  


what are the three main credit bureau names

1 Answers   Synchrony Financial,


what is the difference between proc report and proc format?

7 Answers   CTS,


Categories