Or, in practice, how does the dynamic nature help when processing data in a proc step.
I found this link http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000975382.htm. But it doesn't help much.
Or, in practice, how does the dynamic nature help when processing data in a proc step.
I found this link http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000975382.htm. But it doesn't help much.
"A data file is static; a SAS view is dynamic. ...." - the dynamic aspect here is meant, IMHO, such that if the underlying data members (on which the view is based) changes, the view (the data it returns) is automatically updated, it returns fresh/latest data without the needed for a "refresh". This is simply because the view does not contain/store data, it's like a compiled data step that is "run" each time the view is accessed. The actual sentence from docs is somewhat "promising", but there's not much special behind it once you understand the nature of views.
I'd say the statement could also be used as a tiny warning - if you change/loose/damage the underlying data, the view won't return the original data anymore - the dynamic could also be less safe.
Pls note, that if the underlying structures changes (adding/dropping/modifying column properties) you'd need to recreate the views (both data step view as SQL views) to keep the view valid and apply the changes in underlyings.
It allows you to avoid writing code to process the data every time.
Random example: If my IT dept choose to store my data in files that were monthly and followed a naming convention such as:
Y2014_M01 Y2014_M02
I could theoretically write a view that was
data Y2014/view=Y2014;
set Y2014:;
run;
And then when I needed to process the file I could simply refer to Y2014 as my data set. Then when it was updated monthly I wouldn't need to update my code. A bit of a contrived example but hope it helps to explain.
data class_F;
set sashelp.class;
where sex='F';
run;
data class_M;
set sashelp.class;
where sex='M';
run;
data class/view=class;
set class:;
run;
proc means data=class;
run;