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 |
Describe a time when you were really stuck on a problem and how you solved it?
Which are SAS Windows Clients & SAS Java Clients
wat has been most common programming mistake?
What are the new features included in the new version of SAS Programming Language?
What does error:1 mean?
how do i get last 10obs from a dataset when we don't know about the number of obsevations in that dataset?
In this question, I rename the numeric variable phone to numphone and then try use phone=put(numphone,comma16.) to store the numeric value numphone as a string value in phone. But I get a warning tha numphone already exists and in the data sat phone doesnt exist and numphone is set to missing. Why? data names_and_more; input Name $20. Phone : comma16. Height & $10. Mixed & $8.; Name = tranwrd(Name,' ',' '); rename phone = numphone; phone = put(numphone,comma16.); datalines; Roger Cody 9,087,821,234 5ft. 10in. 50 1/8 Thomas Jefferson 3,158,488,484 6ft. 1in. 23 1/2 Marco Polo 8,001,234,567 5Ft. 6in. 40 Brian Watson 5,183,551,766 5ft. 10in 89 3/4 Michael DeMarco 4,452,322,233 6ft. 76 1/3 ;
What is the pound sign used for in the data_null_ ?
what is pdv? how it is related to input buffer in sas?
What are the data types in sas?
What other SAS features do you use for error trapping and data validation?
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming