I have 2 data sets A & B. Both have a variable called Age in
them, each of them specifying a different functionality.

In my program I use bot these data sets. How do I specify
which Age variable I want to use?

Answers were Sorted based on User's Feedback



I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a di..

Answer / santosh

as per my understanding this is the solution
without renaming the variables the only way is to do using
proc sql;
select a.age,b.age from a,b;
quit;

Is This Answer Correct ?    1 Yes 0 No

I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a di..

Answer / presha badiyani

use rename option

Data a1;
input A $20 @50 age;

Data b1;
input x b age;

Data c;
set a1 b1(rename age=b1_age);
If age = b1_age;
run;

Is This Answer Correct ?    6 Yes 6 No

I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a di..

Answer / poojavaibhav

Deepak please explain the word functionality in detail.

But if i have to answer above question then i think if you have var that have same name in different dataset and you want to use them both then rename one of the variable and apply condition..

thanks.

Is This Answer Correct ?    0 Yes 0 No

I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a di..

Answer / alok karan

Data a1;
input y age;

Data b1;
input x age;

Data c;
set a1 b1(drop=age);
run; 

Is This Answer Correct ?    0 Yes 0 No

I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a di..

Answer / kush

proc sql;
select Variable_name
from Variable_name.DataSet_name;
run;

Is This Answer Correct ?    1 Yes 2 No

I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a di..

Answer / nbohr02

Use a two level name.

Data a1;
input A $20 @50 age;

Data b1;
input x b age;

Data c
If a1.age = b1.age;

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More SAS Interview Questions

What is difference between sas rename and lable?

4 Answers  


What is Tabulate.?Why we use it.? Which type of output we get from Tabulate.?

3 Answers   TCS,


How do you generate random samples?

5 Answers  


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

8 Answers   GSK GlaxoSmithKline,


i have a dataset with 100 obs i want to generate title from 20th obs onwards with total observations. that should contain 100 obs.dont use firstobs and dnt split the data. use dataset block or proc report? how can we genarate;

0 Answers   L&T,






Hi , which book should i refer to for preaparing SAS statistical Exam. Searched a lot on books but still did n't find relevant books

2 Answers  


if you were told to create many records from one record, show how you would do this using array and with proc transpose? : Sas programming

0 Answers  


How would you code a macro statement to produce information on the sas log? This statement can be coded anywhere? : sas-macro

0 Answers  


What are the differences between sum function and using “+” operator?

0 Answers  


How would you code a merge that will keep only the observations that have matches from both sets?

5 Answers  


how do you want missing values handled? : Sas programming

0 Answers  


How do you read in the variables that you need?

5 Answers  


Categories