Answer Posted / ravi
This is nothing but a implict variable created by SAS during
data processing. It gives the total number of records SAS
has iterated in a dataset. It is Available only for data
step and not for procs.
Eg. If we want to find every third record in a Dataset then
we can use the _n_ as follows
Data new-sas-data-set;
Set old;
if mod(_n_,3)= 1 then;
run;
Note: If we use a where clause to subset the _n_ will not
yield the required result.
| Is This Answer Correct ? | 13 Yes | 3 No |
Post New Answer View All Answers
If you were told to create many records from one record, show how you would do this using array and with proc transpose?
What are the parameters of scan function?
How would you invoke a macro? : sas-macro
What do the mod and int function do? : Sas programming
What does proc print, and proc contents are used for?
how to generate the test data in sas without input data? : Sas-administrator
Explain proc univariate?
Can you explain the process of calendar?
Do you need to compute new variables? If so,should you do this before you execute the report-writing procedure?
Of all your work, where have you been the most successful?
What are the features of base sas system?
How will you use the WHO Drug Dictionary for Reporting Clinical Trials?
Explain the main difference between the sas procedures and functions? : Sas-administrator
How do you use the do loop if you don’t know how many times you should execute the do loop?
Explain how you can debug and test your SAS program?