BookmarkSubscribeRSS Feed
Ja5ya
Fluorite | Level 6

Hi, I'm trying to read in MSG file into SAS but wasn't able to do so.

Then I tried using LINUX command, I got it to convert to txt file but it wasn't readable by SAS. I used code like:

data _null_;

 x "cd /source/data/";

 x "rename .msg .txt *.msg";

run;


Can anyone help me in trying to read the Outlook MSG file from SAS? I'm ok with converting the msg file too into txt file but it should be SAS Readable.

 

Please help.

4 REPLIES 4
vellad
Obsidian | Level 7

You need to download the Outlook messages as .txt files and not .msg files. You can't just rename an .msg file as .txt and expect it to behave as .txt, because .msg has its own encoding rules and is not a simple flat file like a .txt file.
If you can't create the .txt files from scratch, you can download and use a utility such as this one to read the .msg files.

KS4NCS
Fluorite | Level 6

Hi Ja5ya,
You can use this python tool also to extract txt from msg file.
https://github.com/TeamMsgExtractor/msg-extractor
Hope this help.

Ja5ya
Fluorite | Level 6
Thanks. I'm looking into it.
SASKiwi
PROC Star

As a test, you can do a "File Save As" on an Outlook message you have opened.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1169 views
  • 1 like
  • 4 in conversation