BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10
data n;
set sashelp.class (drop=height weight);
putlog height weight  ;
run;

In the above code drop variables creates automatic variables in _error_ and _n_ in PDV

even if not uninitialized is it occupied disk space   i am using putlog along with height and weight variables

log window show as below.

 

Anandkvn_0-1680842226263.png

 

 

4 REPLIES 4
Tom
Super User Tom
Super User

I do not understand what you are asking.

You read in SASHELP.CLASS but exclude the HEIGHT and WEIGHT variables.

You then create NEW variables named HEIGHT and WEIGHT by using them in the PUTLOG statement.

Since you never assigned any value to them you will get 19 lines written to the SAS log with two periods (or whatever character you have told SAS to use to represent missing values by change the MISSING system option).

BrahmanandaRao
Lapis Lazuli | Level 10

what PDV does for drop variables any disk space  to read in input buffer 

Tom
Super User Tom
Super User

@BrahmanandaRao wrote:

what PDV does for drop variables any disk space  to read in input buffer 


Do you mean "program data vector"?  I don't use that terminology as it does not really help me think about how SAS works.  Just keep track in your mind about which variables you are using.

 

Since you dropped the HEIGHT and WEIGHT from SASHELP.CLASS before you read them in you can forget about them completely.  They don't exist in this data step.

 

So after the SET statement you have created NAME, SEX and AGE variables.

Then after the PUTLOG statement you have created HEIGHT and WEIGHT.

 

So your data step has 5 variables, two of which will be missing on every observation since no values are ever assigned to them.

Quentin
Super User

I'm not sure what you're asking either.  But the automatic variables _error_ and _n_ are always in the PDV.  They are created by the DATA step itself.

 

1    data _null_ ;
2      put _all_ ;
3    run ;

_ERROR_=0 _N_=1
The Boston Area SAS Users Group is hosting free webinars!
Next up: Troy Martin Hughes presents Calling Open-Source Python Functions within SAS PROC FCMP: A Google Maps API Geocoding Adventure on Wednesday April 23.
Register now at https://www.basug.org/events.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 863 views
  • 0 likes
  • 3 in conversation