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
how many types prompting framework can be broken down to? : Sas-bi
What is a macro routine?
Compare sas with other data analytics tools.
Intern stastical programmer written test
where to use sas business intelligence? : Sas-bi
which date functions advances a date time or date/time value by a given interval? : Sas programming
what is data integration? : Sas-di
What function CATX syntax does?
What is connection profile? : sas-grid-administration
What is the difference between nodupkey and nodup options?
What are the scrubbing procedures in sas?
Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro
What are the difference between sas functions and procedures?
what are some good sas programming practices for processing very large data sets? : Sas programming
How do you control the number of observations and/or variables read or written?