BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
nelsonc
Fluorite | Level 6

I have created a new program that collects a JSON file from the facebook API.

Because facebook allows foreign utf-8 symbols I was unable to use the JSON engine to parse the file. To solve this I run SAS with unicode support. This all works now but my email notification that sends at the end of the program will not work in this utf-8 mode.

What do i have to do to send an email while in the utf-8 encoding? do i have to use an encoding statement somewhere?

*This is the send code -Works in regular sas but does not work while in utf-8 mode:;
ods listing close;
ods noptitle;
ods msoffice2k file=outbox1 style=sapphire;
ods escapechar='^';
title1 "&pdate Facebook Lead Ads Daily Update^n
^n
.";
proc odstext;
   p "--The Facebook Lead Ads Data Update has Completed";
   p " ";
   p "There were ^{style[textdecoration=underline color=red fontweight=bold] &AddedRecords } added to the table Today.";
   p " ";
   p "Reporting Available Here--- ";
   p '<a href=  linkaddresshere.xlsx>SharePoint FB_LeadAds Report</a> ';
   p '<a href=linkaddresshere>DataStudio Subscriptions Report</a> ';
   
run;
title;
ods msoffice2k close;
ods listing;

 

1 ACCEPTED SOLUTION

Accepted Solutions
nelsonc
Fluorite | Level 6

I ended up just splitting the program into two parts that run from bat.

The first part runs the API calls and collects and stores the data, i run this with the  -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\u8\sasv9.cfg" option.

Then the second part runs the email notification and runs with the standard config.

There was probably a more elegant solution but I was pressed for time.

View solution in original post

2 REPLIES 2
nelsonc
Fluorite | Level 6

I ended up just splitting the program into two parts that run from bat.

The first part runs the API calls and collects and stores the data, i run this with the  -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\u8\sasv9.cfg" option.

Then the second part runs the email notification and runs with the standard config.

There was probably a more elegant solution but I was pressed for time.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 1220 views
  • 2 likes
  • 2 in conversation