Please, anyone, let me know the style or an example of using
'by='/'by' variable of a PDV(Program Data Vector)
Answers were Sorted based on User's Feedback
Answer / rajesh
list of 'by' variables tell SAS how data is stored in
source dataset or how it is to be represented in
output/output dataset.
PDV is used to write the observations in output dataset and
it does not get impected from any BY variable as data in
SAS always read sequencely. If BY vaialbes are there then
it just ensures that source dataset is sorted on list of BY
variables. It does not impact other thing.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / 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 |
Answer / gajari rao
pls some one try to answer this question my friend is
waiting for your answer.
All the best pavan mandadi
| Is This Answer Correct ? | 0 Yes | 1 No |
What are the statements that are executed only?
how can you put a "trace" in your program? : Sas programming
if the Id has more then two transcatiion then show the first observation, IF Id has only two observation then It show both the observation
What are MIs reports? what is the use of MIS reports and How can u generate the MIS reports in SAS? If any body know explain with the eg.
2 Answers ABC, ASD Lab, CitiGroup,
What is the difference between one to one merge and match merge? Give an example.
Hi im new to sas. I have a file with some charecter variables and some numeric variables now i want to load charecter variables into one datastep and numeric variables into another data step pls let me know Thanks
What is difference between (a-z) and (a--z)
Hi... this is chandu, did MSc Microbiology, trying to get job in SAS tool, PLZ Tell me whether IT industries will give consider my education to gain a job....?
what is conditional processing?
How would you delete duplicate observations?
what is the Population you used in your project, is it ITT or PP?
0 Answers Accenture, Quintiles,
which date function advances a date, time or datetime value by a given interval? : Sas programming