<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Invalid JSON - Emoji in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827322#M326794</link>
    <description>&lt;P&gt;Thank you, Tom, for your propsosed solution!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, a more general solution is needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The content of the presented JSON string is only a part of a much, much larger file: "&lt;A href="https://data.arbetsformedlingen.se/annonser/historiska/2020.zip" target="_blank" rel="noopener"&gt;https://data.arbetsformedlingen.se/annonser/historiska/2020.zip&lt;/A&gt;". This is the file I need to read and I do not know how many points that will not transcode. Thus it doesn't seem to be a good way of working to change parts of the string for something else every time a Javascript Escape is not recognized.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Strangely enough, SAS seems to have the capability to recognize this Javascript Escape if you read it in through a put statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
file input;
put '{"num_records": 1, "data": [[1, "\ud83d\ude80"]], "data_type": "json"}';
run;
libname input json fileref=input;
proc print data = posts.data;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;With the following result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set POSTS.DATA" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;ordinal_root&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;ordinal_data&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;element1&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;element2&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;&lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-left"&gt;Do you think one could use this to build a more general solution for reading JSON files containing Java Script Escapes?&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Fri, 05 Aug 2022 10:53:48 GMT</pubDate>
    <dc:creator>Multipla99</dc:creator>
    <dc:date>2022-08-05T10:53:48Z</dc:date>
    <item>
      <title>Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827133#M326707</link>
      <description>&lt;P&gt;I'm running the following code in UTF8&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename MYJSON "C:\Temp\JSON TEST\JSON\Emoji.json" encoding=utf8;
libname MYJSON json;   &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and get the following error messages:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: JSON data is only read once.  To read the JSON again, reassign the JSON LIBNAME.
ERROR: Invalid JSON in input near line 1 column 1049: Some code points did not transcode.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the emoji, \ud83d\ude80, the culprit? If yes, how can I get around it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 14:14:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827133#M326707</guid>
      <dc:creator>Multipla99</dc:creator>
      <dc:date>2022-08-04T14:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827142#M326713</link>
      <description>&lt;P&gt;Why do you think that those are emoji?&amp;nbsp; What emoji could they be?&lt;/P&gt;
&lt;P&gt;D83D is not a valid UTF-8 sequence.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://charbase.com/d83d-unicode-invalid-character" target="_blank"&gt;https://charbase.com/d83d-unicode-invalid-character&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;DE80 is not a valid UTF-8 sequence.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://charbase.com/de80-unicode-invalid-character" target="_blank"&gt;https://charbase.com/de80-unicode-invalid-character&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try fixing the file by replacing those with something that does not look like an attempt to define a unicode character.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;11   %put %sysfunc(getoption(encoding,keyword));
ENCODING=UTF-8
12   filename original 'c:\downloads\Emoji.json' ;
13   filename myjson temp;
14   data _null_;
15     infile original;
16     file myjson;
17     input;
18     _infile_=tranwrd(_infile_,'\ude80','*de80*');
19     _infile_=tranwrd(_infile_,'\ud83d','*d83d*');
20     put _infile_;
21   run;

NOTE: The infile ORIGINAL is:
      Filename=c:\downloads\Emoji.json,
      RECFM=V,LRECL=32767,File Size (bytes)=2970,
      Last Modified=04Aug2022:10:18:06,
      Create Time=04Aug2022:10:18:06

NOTE: The file MYJSON is:
      Filename=C:\Users\...\#LN00053,
      RECFM=V,LRECL=32767,File Size (bytes)=0,
      Last Modified=04Aug2022:10:48:35,
      Create Time=04Aug2022:10:48:35

NOTE: 1 record was read from the infile ORIGINAL.
      The minimum record length was 2970.
      The maximum record length was 2970.
NOTE: 1 record was written to the file MYJSON.
      The minimum record length was 2970.
      The maximum record length was 2970.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


22
23   libname myjson json ;
NOTE: JSON data is only read once.  To read the JSON again, reassign the JSON LIBNAME.
NOTE: Libref MYJSON was successfully assigned as follows:
      Engine:        JSON
      Physical Name: C:\Users\...\#LN00053
24   proc copy inlib=myjson outlib=work;
25   run;

NOTE: Copying MYJSON.ALLDATA to WORK.ALLDATA (memtype=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used.
NOTE: There were 1 observations read from the data set MYJSON.ALLDATA.
NOTE: The data set WORK.ALLDATA has 1 observations and 4 variables.
NOTE: Copying MYJSON.ROOT to WORK.ROOT (memtype=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used.
NOTE: There were 1 observations read from the data set MYJSON.ROOT.
NOTE: The data set WORK.ROOT has 1 observations and 2 variables.
NOTE: PROCEDURE COPY used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 14:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827142#M326713</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-08-04T14:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827154#M326718</link>
      <description>If you put the sequence, "\ud83d\ude80", in Unicode escape&amp;nbsp;you will get back a&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt;. Isn't this an emoji?&amp;nbsp;</description>
      <pubDate>Thu, 04 Aug 2022 15:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827154#M326718</guid>
      <dc:creator>Multipla99</dc:creator>
      <dc:date>2022-08-04T15:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827156#M326720</link>
      <description>&lt;A href="https://dencode.com/en/string/unicode-escape" target="_blank"&gt;https://dencode.com/en/string/unicode-escape&lt;/A&gt;</description>
      <pubDate>Thu, 04 Aug 2022 16:00:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827156#M326720</guid>
      <dc:creator>Multipla99</dc:creator>
      <dc:date>2022-08-04T16:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827161#M326722</link>
      <description>&lt;P&gt;If you want to represent that character&amp;nbsp;&lt;A href="https://charbase.com/1f680-unicode-rocket" target="_blank" rel="noopener"&gt;https://charbase.com/1f680-unicode-rocket&lt;/A&gt; try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  _infile_=tranwrd(_infile_,'\ud83d\ude80','&amp;amp;#x1F680;');
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename original '~/test/Emoji.json' ;
filename myjson temp;
data _null_;
  infile original;
  file myjson;
  input;
  _infile_=tranwrd(_infile_,'\ude80\ud83d','&amp;amp;#x1F680;');
  put _infile_;
run;

libname myjson json ;

data test;
 set alldata;
 do offset=0 to length(value) by 80 ;
   value2=substrn(value,offset,80);
   output;
 end;
 keep offset value2;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1659630896434.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74139i6A96B08AA3B6A228/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1659630896434.png" alt="Tom_0-1659630896434.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 16:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827161#M326722</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-08-04T16:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827322#M326794</link>
      <description>&lt;P&gt;Thank you, Tom, for your propsosed solution!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, a more general solution is needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The content of the presented JSON string is only a part of a much, much larger file: "&lt;A href="https://data.arbetsformedlingen.se/annonser/historiska/2020.zip" target="_blank" rel="noopener"&gt;https://data.arbetsformedlingen.se/annonser/historiska/2020.zip&lt;/A&gt;". This is the file I need to read and I do not know how many points that will not transcode. Thus it doesn't seem to be a good way of working to change parts of the string for something else every time a Javascript Escape is not recognized.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Strangely enough, SAS seems to have the capability to recognize this Javascript Escape if you read it in through a put statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
file input;
put '{"num_records": 1, "data": [[1, "\ud83d\ude80"]], "data_type": "json"}';
run;
libname input json fileref=input;
proc print data = posts.data;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;With the following result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set POSTS.DATA" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;ordinal_root&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;ordinal_data&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;element1&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;element2&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;&lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-left"&gt;Do you think one could use this to build a more general solution for reading JSON files containing Java Script Escapes?&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 05 Aug 2022 10:53:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827322#M326794</guid>
      <dc:creator>Multipla99</dc:creator>
      <dc:date>2022-08-05T10:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827338#M326799</link>
      <description>Can you remove these "\uXXXX" string ? or Just read json by data step. I think &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; has many experience about it .</description>
      <pubDate>Fri, 05 Aug 2022 12:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827338#M326799</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-08-05T12:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827347#M326806</link>
      <description>&lt;P&gt;The issue is that the JSON engine is actually trying the transcode the unicode character strings and it apparently it does understand this strange variation that I had never heard of before but apparently that JAVA has decided to use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Open a ticket with SAS support to see if they can enhance the JSON engine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That data step is NOT trying to interpret the Java syntax.&amp;nbsp; It just stored the actual \u characters and the hex digits as normal text and whatever viewer you are using to look at the output is what is deciding to show it as an image instead of text.&amp;nbsp; I guess you are calling this an "Emoji" in the title of your question because the strange Java syntax works like text emojis where you type a colon and right parenthesis next to each other and it looks like a smiley face?&amp;nbsp; The problem is that the individual unicode code points that syntax means in the way SAS is interpreting it are not valid unicode characters.&amp;nbsp; But there is a valid unicode character for that rocket ship image.&amp;nbsp; So it would be best if the system that is generating these JSON files stopped using the JAVA syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 13:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827347#M326806</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-08-05T13:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827356#M326811</link>
      <description>&lt;P&gt;Cannot check that ZIP file as the host seems to be invalid.&lt;/P&gt;
&lt;P&gt;ERROR: Windows SSL error -2146893016 (0x80090328) occurred at line 2694, the error message is "The received certificate has&amp;nbsp;expired. "&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could just try to generate your own list of strings that need to be recoded by using the example data _null_ step I showed.&amp;nbsp; First use it to fix the rocketships and then try to read the resulting file.&amp;nbsp; Once you see another error then look at the offending character and figure out how to fix it and update the data step to replace that string also.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue you might have using my data step is that it treating the file a lines of text.&amp;nbsp; So any line that is longer than 32767 bytes will get truncated.&amp;nbsp; So if you did want to do that it might be better to use different method to replace the strings.&amp;nbsp; Either an outside program, like unix command sed, or a more complex SAS data step.&amp;nbsp; If you want to go the SAS data step route I had had success in the past doing something like that by reading the file as fixed length records.&amp;nbsp; The trick is two use a small enough record length that you can concatenate two records into a single character variable.&amp;nbsp; That way you can find and replace strings that happen to fall over the record boundary.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 13:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827356#M326811</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-08-05T13:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827359#M326813</link>
      <description>Thank you, Tom!&lt;BR /&gt;&lt;BR /&gt;I'm sorry about the ZIP-file. It was possible to download it some week ago. &lt;BR /&gt;&lt;BR /&gt;I also plan to contact SAS Technical support an suggest that they enhance the JSON engine. &lt;BR /&gt;&lt;BR /&gt;In the meantime I might go for your suggested solution, replacing offending characters as they appear. Of course I will watch out for the 32767 bytes limit. &lt;BR /&gt;&lt;BR /&gt;Thank you for your warning about it!</description>
      <pubDate>Fri, 05 Aug 2022 13:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827359#M326813</guid>
      <dc:creator>Multipla99</dc:creator>
      <dc:date>2022-08-05T13:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827360#M326814</link>
      <description>&lt;P&gt;Here is a way that should work.&amp;nbsp; Just replace all of the \ with \\.&amp;nbsp; Then the JSON engine will not try to convert them. Instead you will get the actual \n and \uXXXX strings into the character variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename java 'c:\downloads\Emoji.json';
filename myjson temp;

data _null_;
  infile java recfm=f lrecl=512 ;
  file myjson recfm=n ;
  input ;
  length string $1024;
  nslash = countc(_infile_,'\');
  string = tranwrd(_infile_,'\','\\');
  len = 512+nslash;
  put string $varying1024. len @;
run;

libname myjson json;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Text in modified JSON.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_1-1659707960095.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74193i5DE511CE61B4C478/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_1-1659707960095.png" alt="Tom_1-1659707960095.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Resulting Text in SAS variable.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1659707909221.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74192iC3D4BE0450F84024/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1659707909221.png" alt="Tom_0-1659707909221.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 13:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/827360#M326814</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-08-05T13:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON - Emoji</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/830263#M328061</link>
      <description>&lt;P&gt;&lt;SPAN&gt;SAS Global Technical Support has explained the reason for not being able to read the file as follows.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"Basically SAS reads the file into buffers before parsing the data. On Windows it can happen that a multi-byte (ie emoji) sequence is broken up, leading to a partial character. This provokes the error you see. You can remove a work before the emoji and it will read in just fine, although the behavior is unpredictable. It is not a problem on the Linux platform, so if you have access to SAS on there, it can be used as a workaround."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;They have also &lt;SPAN class="csedbfcf261"&gt; filed a request for SAS developers to consider fixing this in SAS 9.4 M7.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 11:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-JSON-Emoji/m-p/830263#M328061</guid>
      <dc:creator>Multipla99</dc:creator>
      <dc:date>2022-08-25T11:44:28Z</dc:date>
    </item>
  </channel>
</rss>

