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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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