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

Can you use a macro within another macro? If so how would SAS know where the current acro ended and the new one began?

1 Answers  


where will go the observations that were deleted by delete statement?

2 Answers  


How long can a macro variable be? A token? : sas-macro

0 Answers  


How would you remove a format that has been permanently associated with a variables?

3 Answers  


In the flow of DATA step processing, what is the first action in a typical DATA Step?

6 Answers   Accenture,






how to display duplicated observations in a data using base sas.

13 Answers   HCL, TCS,


how do i get last 10obs from a dataset when we don't know about the number of obsevations in that dataset?

7 Answers   TCS,


Tell e how how dealt with..

0 Answers   Wipro,


What is the order of evaluation of the comparison operators: + - * /** ()?

3 Answers   Quintiles,


How do you debug and test your SAS programs?

0 Answers   Quintiles,


What’s the difference between var b1 – b3 and var b1 — b3?

0 Answers  


what are the differences between proc report and proc tabulate?

3 Answers  


Categories