DATA Step, Macro, Functions and more

a DATA step view is implicitly executed when it is referenced as an input data set by another DATA ?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

a DATA step view is implicitly executed when it is referenced as an input data set by another DATA ?

 

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!


Accepted Solutions
Solution
‎04-07-2017 02:03 PM
PROC Star
Posts: 7,492

Re: a DATA step view is implicitly executed when it is referenced as an input data set by another DA

Posted in reply to emoryustc

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


All Replies
Solution
‎04-07-2017 02:03 PM
PROC Star
Posts: 7,492

Re: a DATA step view is implicitly executed when it is referenced as an input data set by another DA

Posted in reply to emoryustc

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

 

Super User
Posts: 11,343

Re: a DATA step view is implicitly executed when it is referenced as an input data set by another DA

Posted in reply to emoryustc

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.

 

SAS Super FREQ
Posts: 3,755

Re: a DATA step view is implicitly executed when it is referenced as an input data set by another DA

Posted in reply to emoryustc

An explanation and simple example in the article "What is a DATA step view and why is it important?"

Occasional Contributor
Posts: 6

Re: a DATA step view is implicitly executed when it is referenced as an input data set by another DA

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

 

 

......

Super User
Posts: 11,343

Re: a DATA step view is implicitly executed when it is referenced as an input data set by another DA

Posted in reply to emoryustc

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".

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 158 views
  • 0 likes
  • 4 in conversation