BookmarkSubscribeRSS Feed
drvasu
Calcite | Level 5

Hi, 

 

Can you please help me to extract the data in this .SAS file into Excel? 

 

5 REPLIES 5
SASJedi
Ammonite | Level 13

This file is a SAS program, not a SAS data set. It contains only SAS code (text). Can you provide details about what you intend to accomplish?

Check out my Jedi SAS Tricks for SAS Users
drvasu
Calcite | Level 5

I would like to get the details of the codes 

PaigeMiller
Diamond | Level 26

@drvasu wrote:

I would like to get the details of the codes 


Ask specific questions about the code. Explain (as @SASJedi said) what it means to extract this into Excel.

--
Paige Miller
Tom
Super User Tom
Super User

If you want to read a text file, like the one you posted, use a DATA step.

data code ;
  infile 'clean data.sas' truncover ;
  row+1;
  input code $char200.;
run;

If you want to write data into Excel you can use PROC EXPORT, or the XLSX libname engine or the ODS EXCEL engine.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 1425 views
  • 0 likes
  • 5 in conversation