i have a null dataset with 10 variables; i want to print only
name of the varibales in log window and also output window.how
can we do this one?

Answers were Sorted based on User's Feedback



i have a null dataset with 10 variables; i want to print only name of the varibales in log window ..

Answer / kumar

if we want variables in output window
data _null_;
file print;
put @5 'name' @20 'age' @30 'sex';
run;

if we want in log window
data _null_;
put @5 'name' @20 'age' @30 'sex';
run;

Is This Answer Correct ?    13 Yes 3 No

i have a null dataset with 10 variables; i want to print only name of the varibales in log window ..

Answer / sasuser

Hi Guys,
Following is the solution:
data _null_;
set sashelp.vcolumn ;
where libname='SASHELP' and memname='CLASS';
file print;
putlog Name @@;
put Name @@;
run;

Is This Answer Correct ?    5 Yes 2 No

i have a null dataset with 10 variables; i want to print only name of the varibales in log window ..

Answer / sas user

* To print in log window
data _null_;
put x1= \
x2= \
x10= \;
run;

* To print on output window:

data _null_;
file print;
put x1= \
x2= \
x10= \;
run;

Is This Answer Correct ?    1 Yes 0 No

i have a null dataset with 10 variables; i want to print only name of the varibales in log window ..

Answer / rohit acharya

The variables of the empty dataset can be easily viewed in the output window with the help of proc contents

Is This Answer Correct ?    0 Yes 0 No

i have a null dataset with 10 variables; i want to print only name of the varibales in log window ..

Answer / solasa

data sm;
input name $ number;
datalines;
run;

dataset in created without observations but the dataset has
varibles.

Is This Answer Correct ?    4 Yes 6 No

i have a null dataset with 10 variables; i want to print only name of the varibales in log window ..

Answer / guest

using proc print statement

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More SAS Interview Questions

How do you generate random samples?

5 Answers  


How to sort in descending order?

0 Answers  


Do you need to combine data sets? How should you combine data sets– MERGE or SET statements in DATA steps,PROC APPEND,PROC SQL?

3 Answers  


WHAT DIFFERRENCE DID YOU FIND AMONG VERSION 6 8 AND 9 OF SAS.

4 Answers   Genzyme,


what is the use of proc sql?

5 Answers   CitiGroup,






Can anyone help to find a statement to get all the predefined formats?

3 Answers   Verinon Technology Solutions,


How to create an external dataset with sas code?

0 Answers  


How to convert HTML file into SAS dataset?

0 Answers  


Name some categories in sas 9? : sas-grid-administration

0 Answers  


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

0 Answers  


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?

3 Answers  


How would you include common or reuse to be processed along with your statements?

0 Answers  


Categories