Help using Base SAS procedures

use of SET statement in SAS

Posts: 0

use of SET statement in SAS

KINDLY HELP ME IN UNDERSTANDING THE code in the second line ( set sc.payroll1 ) below :-

data ticket_agents;
set sc.payroll1 (keep=IDNum JobCode Birth Gender Salary);
where JobCode like 'TA_';

Super Contributor
Super Contributor
Posts: 3,174

Re: use of SET statement in SAS

In addition to the SAS documentation, might I suggest the SAS support website which has much to offer (and it's free to use) for SAS-hosted manuals and supplemental technical and conference reference material. The website has a SEARCH facility or you can use your favorite Internet search choice, such as the Google advanced search argument below:

data step programming set statement

Here is a SAS SUGI/SGF conference tutorial paper for your consideration:

Programming with the KEEP, RENAME, and DROP Data Set Options
Stephen Philp, Pelican Programming, Los Angeles, CA

Scott Barry
SBBWorks, Inc.
Posts: 0

Re: use of SET statement in SAS

Hi Mark,

If you are comfortable with SQL, in simple words-

set sc.payroll1 is equivalent to select * from sc.payroll1 where SC is the library where the dataset is stored and payroll1 is the dataset.

if you use the "keep" statement with the columns given below
select * -- changes to
select IDNum, JobCode, Birth, Gender, Salary from sc.payroll1.

setting the dataset basically copies the dataset into the input buffer for further use.

Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation