can any body explain me about pdv

Reply
Occasional Contributor
Posts: 10

can any body explain me about pdv

can any body explain me about pdv

Super Contributor
Posts: 644

Re: can any body explain me about pdv

The Program Data Vector (PDV) is a stage in the processing of a SAS data step.  SAS first reads the code for a data step and notes all the variables that will be involved at any stage.  So all the columns in any tables referenced in Set, Merge or Update statements will be included, plus any reverenced in Format, informat, Length or Attrib statements, in Array statements and the like, not to mention any of the other multiple ways a variable can be defined in SAS; and then it adds a number of automatic variables such as _N_.  All of these are allocated enough memory to hold a single complete row of values.  This is the PDV.

In executing the data step SAS reads input data (if any) into a buffer which may hold several rows of data; these are then moved or copied in turn into the PDV one by one for processing.

Richard

Super Contributor
Posts: 644

Re: can any body explain me about pdv

Did you find this explanation useful?  If so, it would be polite to acknowledge.  If not, can you tell me what additional detail would be useful.

You might also like to refer to SAS documentation

SAS(R) 9.2 Language Reference: Concepts, Second Edition

Richard

Contributor
Posts: 74

Re: can any body explain me about pdv


please go through the attcahed file. I think this will help you.

Regards

Tarun Kumar

Occasional Contributor
Posts: 12

Re: can any body explain me about pdv

this helped me - thanks

Occasional Contributor
Posts: 12

Re: can any body explain me about pdv

another PDV question.  I am in process of learning SAS-I have been asked to create permanent variable that will save the value of _n_ from PDV into the output data set.  I know how to create permanent variable (thanks to your slide show) but do not know how to reference PDV n.  Can you help me?

Occasional Contributor
Posts: 11

Re: can any body explain me about pdv

Hi Patricia,

     The variable _n_ is refered to as _n_ so you code would look like this:

data output;

     set input;

     curobsnum = _n_;

run;

Hope this helps,

Yoan

Occasional Contributor
Posts: 12

Re: can any body explain me about pdv

Thank you - that was perfect

Frequent Contributor
Posts: 114

Re: can any body explain me about pdv

Hi,

PDV (Program Data Vector) : The information about each of the variables is stored in a reserved area of memory called PDV.

SAS Processes data steps in two stages : (1) Compile Stage  (2) Execution Stage

In Compile stage SAS does some housekeeping jobs like to prepare an area to store the sas dataset, then to check input file ( infile statement) to fix various attribute of input file. Then to put all the information at a place in memory called as INPUT BUFFER (where it place each record of data as it is read from the input file).

SAS checks for each variable is character or numeric and the storage length of each variable, this information is called the descriptor portion of the data set.

Descriptor Portion contains : Name of data set, Date and time that the data set was created , Number of observations and the number of variables

                                          (It contains attribute information for each variable in the data set )

SAS does following action during compile stage :

(a) Syntax Scan    (b) Sas Source code translation to machine language

(c) Definition of input and output files  (d) Create input buffer, PDV and data set descriptor information

(e) Setting the variable attribute for output sas data set. (f) Capture of variables to be initialized to missing.

Ask a Question
Discussion stats
  • 8 replies
  • 312 views
  • 2 likes
  • 6 in conversation