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

Intern stastical programmer written test

0 Answers  


Describe the ways in which you can create a macro variable?

0 Answers  


What is the purpose of the trailing @? The @@? How would you use them?

10 Answers   Accenture,


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 sas features do you use to check errors and data validation?

0 Answers  






what is Difference between PROC SQL JOINS and MERGE?

3 Answers   Accenture, Wipro,


sas macros

12 Answers   TCS,


How to find out no. of business days in a month using macros.???(excluding weekends and holidays).

2 Answers   HSBC,


How do dates work in sas?

0 Answers  


Name validation tools used in SAS

0 Answers  


what cause the "error: connect:" and "error in the libname statement" when there weren't any such problems?

0 Answers  


what are methods to identify duplicate observations?

5 Answers   HCL,


Categories