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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 499 views
  • 2 likes
  • 2 in conversation