BookmarkSubscribeRSS Feed
Hemanth003
Calcite | Level 5

1) is it possible to read a SAS file which is embedded in excel file ?if at all yes!! how? pls find the attachment.

2) is it possible to read a .b1 extension file in SAS? for example test.b1 

 

3 REPLIES 3
SASKiwi
PROC Star

1) I can't think of any easy way programmatically. A simple File Save As in Excel or manual copy and paste will work. Personally I think it is bad practice to hide away SAS files inside another vendor's files. Why not store them as designed as simple text files?

2) Does the .b1 extension have any significance or is it simply just a text file containing data? If it is just a text file then no problem.  

Kurt_Bremser
Super User

That somehow reminds me of the person that sent me a SAS log by embedding a screenshot in jpg format in an Excel file. Instead of just copy/pasting the text into the email.

 

Bottom line: don't even think about it. SAS files are SAS files and should always be stored as such.

If someone sent you that abomination, request to have data sent the right way.

Kurt_Bremser
Super User

Question 2: The extension is just part of the name, it does not tell you anything about the file's contents in a guaranteed way. If you rename garbage.xlsx to garbage.txt, it's still an Excel file, and you can't read it as text.

SAS will read any text file in a data step, even if it's named myfile.somestupidextensionimadeup

Look at the file documentation to decide how to import the contents into SAS.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 642 views
  • 0 likes
  • 3 in conversation