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
BASUG is hosting free webinars ! Check out our recordings of past webinars: https://www.basug.org/videos. Be sure to subscribe to our email list for notification of future BASUG events.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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