Help using Base SAS procedures

use of SET statement in SAS

Reply
N/A
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_';
run;

regards
markc
Super Contributor
Super Contributor
Posts: 3,174

Re: use of SET statement in SAS

Posted in reply to deleted_user
In addition to the SAS documentation, might I suggest the SAS support http://support.sas.com/ 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 site:sas.com

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

http://www2.sas.com/proceedings/sugi31/248-31.pdf

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: use of SET statement in SAS

Posted in reply to deleted_user
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.

Thanks,
Saurabh.
Ask a Question
Discussion stats
  • 2 replies
  • 129 views
  • 0 likes
  • 2 in conversation