Please, anyone, let me know the style or an example of using
'by='/'by' variable of a PDV(Program Data Vector)
Answer Posted / cutepa1
Thanks Rajesh, Here I got the appropriate answer for the
above question. A PDV has got such two variables like
'first.<BY-variable> and last.<BY-variable> apart from other
temporary variables. Here a BY-variable is the variable that
is mentioned in BY statement. a first.<var> returns 1 when a
first obs of that variable's datavalue is iterated or
contributed and returns 0 for the remaining other obs whose
datavalue of that specified variable in the BY-statement.
Respectively it returns 1 for when last obs is contributed
with the usage of last.<BY-variable> and returns 0 for the
rest of the observations.
Here I got an example
=======
data ex;
set emp; /* a source table retrived from Oracle emp */
by deptno; /* we can call 'deptno' as our BY-variable */
lead=first.deptno; /* new variable called lead that returns
the value either 1 or 0 basing on deptno*/
follow=last.deptno;
run;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
what is data integration? : Sas-di
How will you generate test data with no input data?
what do you mean by data staging area? : Sas-di
Explain the main difference between the sas procedures and functions? : Sas-administrator
How do you connect the desktop application to metadata server? : sas-grid-administration
what is the difference between nodup and nodupkey options? : Sas programming
what is the Population you used in your project, is it ITT or PP?
What are the uses of sas?
How are numeric and character missing values represented internally?
Of all your work, where have you been the most successful?
Describe what are the different levels of administrative users in sas? : sas-grid-administration
what is the function of catx syntax? : Sas-administrator
what is star schema? : Sas-di
What is the differnce between SDTM 3.1.2 to 3.1.1 version
in the flow of data step processing, what is the first action in a typical data step? : Sas programming