BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am trying to use a simple expression is Enterprise Guide looking at one column of data. My question is how do you call the column and the cells.

if abs((x+1)-x)>0.05

then y = ((x+1)-x);

else y=0;
1 REPLY 1
deleted_user
Not applicable
SAS is a data oriented processing language.
It views the world through datasets = tables.
Each row or record is called an observation.
Each column or field is a variable defined for that dataset.
SAS assumes you want to process each observation in a dataset, with the goal of deriving summarized statistics: sum, count, max, min, mean, median, stddev, etc. or regressions, correlations, etc.
SAS assumes you want to report on the summarized data as well.

So, to simplify the programming efforts, you don't necessarily need to open, read, loop through, and close a file. It is assumed within the context of a DATA Step.

DATA dummy;
set indata;
y = a*x + b;
run;
quit;

indata would have been already created, containing the variables a, x and b.
indata could have as few as 1 observation or > 1,000,000,000 observations, and SAS will calculate y = ax + b for each observation.
The resulting dataset is called "dummy" and can be used for input into other data steps or proc's.

SAS also supports SQL processing:

proc sql;
create table dummy as
select a, x, b, (a*x + b) as y
from indata;
quit;

In Enterprise Guide, you either use a code block or select a dataset, right click on it and select "Filter and Query ..." or select "Filter and Query ... " from the Data menu. This brings up a dialog box for creating an SQL query. One of the features of the Query dialog box is the ability to define "Computed Columns".

I would recommend you use the OnLine help within EG to help you learn about the product. Also, if you have PC SAS on your box, it also has extensive help and documentation. SAS Help documentation comes in multiple flavors: This is what SAS is all about, This is how you can use SAS, This is how to use SAS, these are the specific details of all the pieces of SAS, This is how you do analysis, This is how SAS helps you do analysis, etc. Message was edited by: Chuck

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 591 views
  • 0 likes
  • 1 in conversation