BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
deleted_user
Not applicable
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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1091 views
  • 0 likes
  • 2 in conversation