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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable? : sas-macro

595


what are the new features included in the new version of sas i.e., Sas 9.1.3? : Sas programming

547


What are the different operating system platforms in which we can use sas? : sas-grid-administration

591


Is the physical structure of the data set in the same orientation as the report? Do you need to reshape the data sets? What method should you use to reshape the data–DATA steps,PROC TRANSPOSE,output data set from a procedure?

1768


how are numeric and character missing values represented internally? : Sas programming

620






What is the difference between %local and %global? : sas-macro

669


What is the differnce between SDTM 3.1.2 to 3.1.1 version

4609


Hello Friends, am new to this forum and am not good at sas progarmming. please can any one of you send me couple of sample large sample SAS Jobs which can you use 200 MB of data and other sas job upto 25GB of data. am doing a performance testing on our legacy systems and new upgraded system. I would really appreciate if you can do me this favor Thank you Priya

1349


Enlist the syntax rules followed in sas statements.

617


What does PROC print, and PROC contents do?

730


Describe 5 ways to do a “table lookup” in SAS?

701


what do you mean by data staging area? : Sas-di

605


Explain how you can debug and test your SAS program?

565


What is your favorite all time computer book? Why?

2050


if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...

945