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 |
1.How to draw pivot tables in Excel by using SAS and in which version we can use VB script for to draw pivot tables in Excel? Answer with example data. 2.What are the advantages of _NULL_ in Data steps? Can we use _NULL_ in Proc steps also? 3. How to call the macro variable into Data Steps? 4. Can we draw pivot tables in Excel using Proc SQL? Please post answers for the above questions with suitable examples, and how to use VB script for Excel using SAS.
Code a PROC SORT on a data set containing State, District and County as the primary variables, along with several numeric variables?
Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.
When looking for data contained in a character string of 150 bytes, which function is the best to locate that data: scan, index, or indexc?
How to read the file names of a text files from a shared drive using SAS?
Do you think professionally?
Approximately what date is represented by SAS date value of 730
If a variable contains letters or special characters, can it be numeric data type?
What are the criticality that you have faced during your project in SAS?
what are sas bi dashboard components? : Sas-bi
In which case u go for libname and in which case u go for proc sql pass thru facilit diff?
What system options would you use to help debug a macro? : sas-macro