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;
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.
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.
Ready to level-up your skills? Choose your own adventure.