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

how can you improve the performance of a query, If it is excuting very slowly?

2 Answers   Zensar,


How to specify variables to be processed by the freq procedure?

0 Answers  


what is sas olap server? : Sas-di

0 Answers  


What can you learn from the SAS log when debugging?

0 Answers   Quintiles,


describe about physical data integration? : Sas-di

0 Answers  






What is the work of tranwrd function?

0 Answers  


hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?

1 Answers   Pfizer,


What is the difference between Regression and Logistic Regression? Can u explain the Assumptions/Conditions?

3 Answers  


What r all the reporting procedures...?

3 Answers  


what is sas enterprise intelligence architecture? : Sas-bi

0 Answers  


Can you explain the process of calendar?

0 Answers  


What is LOGICAL VARIABLES in SAS.And how it can be used..Can anyone support..???

3 Answers  


Categories