Skip to main content

  • Software
    • Software
    • SAS Viya
    • Industries
    • Solutions
    • Products
  • Learn
    • Learn
    • Training
    • Certification
    • Academics
    • Video Tutorials
  • Support
    • Support
    • Communities
    • Documentation
    • Developers
    • Support & Services
    • User Groups
  • About Us
    • About Us
    • Why SAS?
    • Company
    • Careers
    • Newsroom
    • Events
    • Contact Us
  • Explore
    • Explore
    • Try & Buy
    • Why SAS?
    • Customer Stories
    • Partners
    • Consulting
  • Software
  • SAS Viya
  • Industries
  • Solutions
  • Products
  • Learn
  • Training
  • Certification
  • Academics
  • Video Tutorials
  • Support
  • Communities
  • Documentation
  • Developers
  • Support & Services
  • User Groups
  • About Us
  • Why SAS?
  • Company
  • Careers
  • Newsroom
  • Events
  • Contact Us
  • Explore
  • Try & Buy
  • Why SAS?
  • Customer Stories
  • Partners
  • Consulting
  • sas.com
  • support.sas.com
  • blogs.sas.com
  • communities.sas.com
  • developer.sas.com

Select your region

Visit the Cary, NC, USA corporate headquarters site

Americas

Europe

Middle East & Africa

Asia Pacific

View our worldwide contacts list for help finding your region

Americas

  • Argentina
  • Brasil
  • Canada (English)
  • Canada (Français)
  • Chile
  • Colombia
  • México
  • Peru
  • United States

Europe

  • Albania
  • Belgium
  • Bosnia & Herz.
  • Česká Republika
  • Croatia
  • Danmark
  • Deutschland
  • Ελλάδα
  • España
  • France
  • Iceland
  • Ireland
  • Italia
  • Luxembourg
  • Magyarország
  • Montenegro
  • Nederland
  • Norge
  • North Macedonia
  • Österreich
  • Polska
  • Portugal
  • România
  • Россия
  • Schweiz (Deutsch)
  • Serbia
  • Slovenia
  • Slovensko
  • Suisse (Français)
  • Suomi
  • Sverige
  • Türkiye
  • Україна
  • United Kingdom

Middle East & Africa

  • Maroc
  • Middle East
  • Saudi Arabia
  • South Africa

Asia Pacific

  • Australia
  • 中国 (简体中文)
  • Hong Kong
  • India
  • Indonesia (Bahasa)
  • Indonesia (English)
  • 日本
  • 대한민국
  • Malaysia
  • New Zealand
  • Philippines
  • Singapore
  • 台灣 (繁體中文)
  • Thailand (English)
  • ประเทศไทย (ภาษาไทย)
  • Contact Us
Sign In

Create Profile

My SAS

Get access to My SAS, trials, communities and more.

Sign Out

Edit Profile

My SAS

Get access to My SAS, trials, communities and more.

SAS Sites

sas.com
Support
Blogs
Communities
Developer
Curiosity
Videos
Merchandise
Brand
PartnerNet

Data Step Samples

Browse DATA Step Samples

  • Array Processing
  • BY-Group Processing
  • CALL routines
  • Component Objects
  • Functions, Character
  • Functions, Date &Time
  • Functions, External Files
  • Functions, Mathematical
  • Functions, SAS File I/O
  • Functions, Special
  • Functions, State & Zip
  • Functions, Truncation
  • MERGE
    • with BY
    • with IN=
  • MODIFY
    • with BY
    • with KEY=
    • with POINT=
  • Random Sampling
  • Reading and Writing External Data
  • Report Writing
  • SET
    • with BY
    • with IN=
    • with KEY=
    • with NOBS=
    • with POINT=
  • UPDATE
  • Utilities
Web
  1. SAS Support
  2. Knowledge Base
  3. Data Step Samples
  1. SAS Support
  2. Knowledge Base
  3. Data Step Samples

Curiosity is our code. SAS analytics solutions transform data into intelligence, inspiring customers around the world to make bold new discoveries that drive progress.

Contact Us

Follow Us

  • Facebook
  • Twitter
  • LinkedIn
  • YouTube
  • RSS

Explore

  • Accessibility
  • Careers
  • Certification
  • Communities
  • Company
  • Developers
  • Documentation
  • For Educators
  • Events
  • Industries
  • My SAS
  • Newsroom
  • Products
  • SAS Viya
  • Solutions
  • Students
  • Support & Services
  • Training
  • Try/Buy
  • Video Tutorials
  • Why SAS?

What is...

What is...

  • Analytics
  • Artificial Intelligence
  • Cloud Computing
  • Data Science
  • Digital Transformation
  • Internet of Things
  • Privacy Statement
  • Terms of Use
  • Trust Center
  • ©2023 SAS Institute Inc. All Rights Reserved.
  • Contact Us
  • Share
  • Subscribe

Share this
Share this page with friends or colleagues. 

Back to Top