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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.