BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
emoryustc
Calcite | Level 5

 

anyone can help me to understand this:

 

"a DATA step view is implicitly executed when it is referenced as an input data set by another DATA or PROC step. Its main purpose is to provide data, one record at a time, to the invoking procedure or DATA step"

 

more informaiton is appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

A full description can be found at: http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#n07vq6hmss6f67n1vhnn...

 

When you set a data or include a data step view in any process (data step or proc) all of the statements that were included in the run that created the view are executed.

 

Art, CEO, AnalystFinder.com

 

View solution in original post

5 REPLIES 5
art297
Opal | Level 21

A full description can be found at: http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#n07vq6hmss6f67n1vhnn...

 

When you set a data or include a data step view in any process (data step or proc) all of the statements that were included in the run that created the view are executed.

 

Art, CEO, AnalystFinder.com

 

ballardw
Super User

Maybe a small concrete example will help a bit.

data work.class/view= work.class;
   set sashelp.class;
 run;

 proc freq data=work.class;
    tables height;
 run;

 proc freq data=work.class;
    tables sex;
run;

If you look at the log you will notice that each of the Proc Freq statements that reference the view created in the datastep  references reading SASHELP.CLASS and then WORK.CLASS. Every time WORK.CLASS is used it re-reads SASHELP.CLASS.

 

emoryustc
Calcite | Level 5

What Can You Do with a DATA Step View?


Using a DATA step view, you can do the following:
directly process any file that can be read with an INPUT statement
read other SAS data sets
generate data without using any external data sources and without creating an intermediate SAS data file

 

 

......

ballardw
Super User

My main use for Views involves combining multiple data sets that are updated at different intervals. That way when I use the View I get all of the latest data without having to worry about "am I missing the data that may have been updated yesterday".

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 5 replies
  • 1348 views
  • 0 likes
  • 4 in conversation