6) Explain about below automatic variables
a) _N_
b) _ERROR_
c) _CHAR_
d) _NUMERIC_
e) _ALL_
f) FIRST.BY VARIABLE
g) LAST.BY VARIABLE
h) _NAME_
i) _TYPE_
j) _FREQ_
k) _STAT_
l) _BREAK



6) Explain about below automatic variables a) _N_ b) _ERROR_ c) _CHAR_ d) _NUMERIC_ e) _ALL_ f..

Answer / vrana95

Automatic variables are created automatically in the data statements and they are added to the PDV but not ouput to
to the resulting dataset which we want.

1)_N_ : number of times the data step has iterated. initially it is 1 and it's counter increases +1 , every time data steps crosses the data statements.

2)_ERROR_: It is 0 by default but is set to 1 every time
the error is encountered.

3)_CHARACTER_ : could be defined in the arrays and other data step programming to include all the character variables.

4)_NUMERIC_ : To include all the numeric variables

5)First.by variable and LAST.By : Whenever, we define a BY parameter with the SET statement, by default two
automatic variables are created in the background and we can utilize them for limiting the rows which we are interested in . {http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000761931.htm}

7) _NAME_ : During transpose the variables you define in VAR statment are transposed and they comes in _NAME_ variable.

proc transpose data=x out=y prefix=m;
by variable1;
id variable2;
var variable3;
run;

8)_TYPE_ and _FREQ_: When you use PROC SUMMARY or PROC MEANS and we define Class parameter for two variables, and we use CHARTYPE in our Proc summary options, then
we get two automatic variables _TYPE_ and _FREQ_ . We can utilize it to limit the output we need.

9)_STAT_ :The default output of PROC MEANS, when no statistics are listed in the OUTPUT statement, is a data set containing a _STAT_ variable and the variables listed in the VAR statement. The output data set contains five records, one for each default statistic N, MIN, MAX, MEAN, and STD.

10) _BREAK_ : PROC report automatically create a variable
_BREAK_.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More SAS Interview Questions

what is the diff b/w verification validation in sas

3 Answers   SAS,


what is the usage for assigning error=1 in a dataset ?

2 Answers   Satyam,


What is the difference between INPUT and INFILE ?

0 Answers  


how to get second highest salary from a employee table and how get a 5th highest salary from a employee table?

11 Answers   ABC, Amex,


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

9 Answers  






What would be the result of the following SAS function (given that 31 Dec, 2000 is Sunday)?

0 Answers  


Are you sensitive to code walk-throughs peer review or QC review?

0 Answers   Quintiles,


Tell different ways to create Macrovarible?

3 Answers   Accenture, PharmaNet i3,


6) Explain about below automatic variables a) _N_ b) _ERROR_ c) _CHAR_ d) _NUMERIC_ e) _ALL_ f) FIRST.BY VARIABLE g) LAST.BY VARIABLE h) _NAME_ i) _TYPE_ j) _FREQ_ k) _STAT_ l) _BREAK

1 Answers   IBM, SAS,


What's the difference between VAR A1 - A4 and VAR A1 - A4?

1 Answers   Quintiles,


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

3 Answers  


What is _n_?

23 Answers   Accenture,


Categories