How will you assign all the variables of an dataset into a
macro variable separated by a space? For example if a
dataset has variables A,B,C. Assign them to a macro variable
X as
X=A B C

Answers were Sorted based on User's Feedback



How will you assign all the variables of an dataset into a macro variable separated by a space? For..

Answer / raghu kishor. k

proc contents data= dsname out=o/pdsname;
run;

proc sql; select name into: macrovariablename separated
by ' 'from o/pdsname;
quit;

Is This Answer Correct ?    12 Yes 1 No

How will you assign all the variables of an dataset into a macro variable separated by a space? For..

Answer / somanath

PROC CONTENTS DATA=SASHELP.CLASS OUT=T VARNUM;
RUN;

PROC SQL NOPRINT;
SELECT NAME INTO : Y separated BY ' ' FROM T ;
QUIT;



%put &Y;

Is This Answer Correct ?    0 Yes 0 No

How will you assign all the variables of an dataset into a macro variable separated by a space? For..

Answer / yuyin

Use PROC SQL; Select * into: macro_variables separated
by ' ' from table;

Is This Answer Correct ?    4 Yes 7 No

Post New Answer

More SAS Interview Questions

Name statements that are execution only.

14 Answers   Accenture,


explain the function of substr in sas? : Sas-administrator

0 Answers  


What happens in the following code, if u type 8 instead of *? proc sql noprint; create table abc as select 8 from lib.abc; quit;

3 Answers  


what is the difference between %put and symbolgen?

6 Answers  


Explain proc univariate?

0 Answers  


how do you debug and test your sas programs? : Sas programming

0 Answers  


What procedure you used to calculate p-value?

2 Answers   Accenture, Quintiles,


Differences between where and if statement?

0 Answers  


How the date 04oct1994 is stored in SAS,not only give the answer explain in brief?

5 Answers  


At compile time when a SAS data set is read, what items are created?

5 Answers  


State the difference between INFORMAT and FORMAT ?

0 Answers  


in the flow of data step processing, what is the first action in a typical data step? : Sas programming

0 Answers  


Categories