<?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 Parsing JSON data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680847#M205863</link>
    <description>&lt;P&gt;Hi i have a&amp;nbsp; dataset&amp;nbsp; of lets say 10 records&amp;nbsp; and one column with a value like this below {"userCostCenter":1020,"countryCode":"CA","userMutualFundUpdateAccess":"true",&lt;/P&gt;
&lt;P&gt;"keepAliveURL":"&lt;A href="https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet&amp;quot;,&amp;quot;returnURL&amp;quot;:&amp;quot;https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet&amp;quot;,&amp;quot;languageCode&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;sessionLength&amp;quot;:10800,&amp;quot;userLogonID&amp;quot;:&amp;quot;TESTC35" target="_blank" rel="noopener"&gt;https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet",&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet&amp;quot;,&amp;quot;returnURL&amp;quot;:&amp;quot;https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet&amp;quot;,&amp;quot;languageCode&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;sessionLength&amp;quot;:10800,&amp;quot;userLogonID&amp;quot;:&amp;quot;TESTC35" target="_blank" rel="noopener"&gt;"returnURL":"https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet",&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet&amp;quot;,&amp;quot;returnURL&amp;quot;:&amp;quot;https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet&amp;quot;,&amp;quot;languageCode&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;sessionLength&amp;quot;:10800,&amp;quot;userLogonID&amp;quot;:&amp;quot;TESTC35" target="_blank" rel="noopener"&gt;"languageCode":"en","sessionLength":10800,"userLogonID":"TESTC35&lt;/A&gt;"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and&amp;nbsp; i need to parse&amp;nbsp; this so&amp;nbsp; that the new&amp;nbsp; dataset would&amp;nbsp; have&amp;nbsp;&lt;/P&gt;
&lt;P&gt;userCostCenter,countryCode, UserMutualFundUpdateAccess , keepAliveURL,&amp;nbsp; returnURL, languageCode, sessionLength, and&amp;nbsp;userLogonID as&amp;nbsp; columns&amp;nbsp; and '1020','CA','true'.... as their respective values . How do i&amp;nbsp; do that?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact&amp;nbsp; i created&amp;nbsp; this dataset&amp;nbsp; by importing a&amp;nbsp; JSON file into SAS. Is there a&amp;nbsp; way i can parse this even before importing the&amp;nbsp; file into SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd appreciate any suggestions . Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Sep 2020 02:21:38 GMT</pubDate>
    <dc:creator>Tal</dc:creator>
    <dc:date>2020-09-02T02:21:38Z</dc:date>
    <item>
      <title>Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680847#M205863</link>
      <description>&lt;P&gt;Hi i have a&amp;nbsp; dataset&amp;nbsp; of lets say 10 records&amp;nbsp; and one column with a value like this below {"userCostCenter":1020,"countryCode":"CA","userMutualFundUpdateAccess":"true",&lt;/P&gt;
&lt;P&gt;"keepAliveURL":"&lt;A href="https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet&amp;quot;,&amp;quot;returnURL&amp;quot;:&amp;quot;https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet&amp;quot;,&amp;quot;languageCode&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;sessionLength&amp;quot;:10800,&amp;quot;userLogonID&amp;quot;:&amp;quot;TESTC35" target="_blank" rel="noopener"&gt;https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet",&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet&amp;quot;,&amp;quot;returnURL&amp;quot;:&amp;quot;https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet&amp;quot;,&amp;quot;languageCode&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;sessionLength&amp;quot;:10800,&amp;quot;userLogonID&amp;quot;:&amp;quot;TESTC35" target="_blank" rel="noopener"&gt;"returnURL":"https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet",&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet&amp;quot;,&amp;quot;returnURL&amp;quot;:&amp;quot;https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet&amp;quot;,&amp;quot;languageCode&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;sessionLength&amp;quot;:10800,&amp;quot;userLogonID&amp;quot;:&amp;quot;TESTC35" target="_blank" rel="noopener"&gt;"languageCode":"en","sessionLength":10800,"userLogonID":"TESTC35&lt;/A&gt;"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and&amp;nbsp; i need to parse&amp;nbsp; this so&amp;nbsp; that the new&amp;nbsp; dataset would&amp;nbsp; have&amp;nbsp;&lt;/P&gt;
&lt;P&gt;userCostCenter,countryCode, UserMutualFundUpdateAccess , keepAliveURL,&amp;nbsp; returnURL, languageCode, sessionLength, and&amp;nbsp;userLogonID as&amp;nbsp; columns&amp;nbsp; and '1020','CA','true'.... as their respective values . How do i&amp;nbsp; do that?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact&amp;nbsp; i created&amp;nbsp; this dataset&amp;nbsp; by importing a&amp;nbsp; JSON file into SAS. Is there a&amp;nbsp; way i can parse this even before importing the&amp;nbsp; file into SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd appreciate any suggestions . Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 02:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680847#M205863</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2020-09-02T02:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680849#M205865</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; In fact&amp;nbsp; i created&amp;nbsp; this dataset&amp;nbsp; by importing a&amp;nbsp; JSON file into SAS. Is there a&amp;nbsp; way i can parse this even before importing the&amp;nbsp; file into SAS?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I am unsure what this means&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 02:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680849#M205865</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-02T02:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680852#M205868</link>
      <description>&lt;P&gt;How did you import your JSON file, as a text file or using the JSON libname?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2016/12/02/json-libname-engine-sas/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2016/12/02/json-libname-engine-sas/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/34400"&gt;@Tal&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi i have a&amp;nbsp; dataset&amp;nbsp; of lets say 10 records&amp;nbsp; and one column with a value like this below {"userCostCenter":1020,"countryCode":"CA","userMutualFundUpdateAccess":"true",&lt;/P&gt;
&lt;P&gt;"keepAliveURL":"&lt;A href="https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet&amp;quot;,&amp;quot;returnURL&amp;quot;:&amp;quot;https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet&amp;quot;,&amp;quot;languageCode&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;sessionLength&amp;quot;:10800,&amp;quot;userLogonID&amp;quot;:&amp;quot;TESTC35" target="_blank" rel="noopener"&gt;https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet",&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet&amp;quot;,&amp;quot;returnURL&amp;quot;:&amp;quot;https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet&amp;quot;,&amp;quot;languageCode&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;sessionLength&amp;quot;:10800,&amp;quot;userLogonID&amp;quot;:&amp;quot;TESTC35" target="_blank" rel="noopener"&gt;"returnURL":"https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet",&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet&amp;quot;,&amp;quot;returnURL&amp;quot;:&amp;quot;https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet&amp;quot;,&amp;quot;languageCode&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;sessionLength&amp;quot;:10800,&amp;quot;userLogonID&amp;quot;:&amp;quot;TESTC35" target="_blank" rel="noopener"&gt;"languageCode":"en","sessionLength":10800,"userLogonID":"TESTC35&lt;/A&gt;"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and&amp;nbsp; i need to parse&amp;nbsp; this so&amp;nbsp; that the new&amp;nbsp; dataset would&amp;nbsp; have&amp;nbsp;&lt;/P&gt;
&lt;P&gt;userCostCenter,countryCode, UserMutualFundUpdateAccess , keepAliveURL,&amp;nbsp; returnURL, languageCode, sessionLength, and&amp;nbsp;userLogonID as&amp;nbsp; columns&amp;nbsp; and '1020','CA','true'.... as their respective values . How do i&amp;nbsp; do that?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact&amp;nbsp; i created&amp;nbsp; this dataset&amp;nbsp; by importing a&amp;nbsp; JSON file into SAS. Is there a&amp;nbsp; way i can parse this even before importing the&amp;nbsp; file into SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd appreciate any suggestions . Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680852#M205868</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-09-02T03:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680854#M205870</link>
      <description>&lt;P&gt;as&amp;nbsp; a&amp;nbsp; text file, using the "infile". It has several columns and one&amp;nbsp; is in JSON&amp;nbsp; format (the one&amp;nbsp; i shared )&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:14:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680854#M205870</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2020-09-02T03:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680856#M205872</link>
      <description>Write that data back out to a text file and then use the JSON libname to try and read it in would be my suggestion.</description>
      <pubDate>Wed, 02 Sep 2020 03:16:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680856#M205872</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-09-02T03:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680857#M205873</link>
      <description>&lt;P&gt;Something as simple as the example you show that is&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;just simple name/value pairs separated by commas.&amp;nbsp; You can just use SCAN() function.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  string='
{"userCostCenter":1020
,"countryCode":"CA"
,"userMutualFundUpdateAccess":"true"
,"keepAliveURL":"https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet"
,"returnURL":"https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet"
,"languageCode":"en"
,"sessionLength":10800
,"userLogonID":"TESTC35"
}';
length pair $300 name $50 value $300 ;
do index=1 to countw(string,'{,}','q');
   pair = scan(string,index,'{,}','q');
   name = dequote(scan(pair,1,':','q'));
   value = dequote(scan(pair,2,':','q'));
   select (name);
      when ('userCostCenter') userCostCenter=input(value,32.);
      when ('countryCode') countryCode=value;
      when ('userMutualFundUpdateAccess') userMutualFundUpdateAccess=value;
      when ('keepAliveURL') keepAliveURL=value;
      when ('returnURL') returnURL=value;
      when ('languageCode') languageCode=value;
      when ('sessionLength') sessionLength=input(value,32.);
      when ('userLogonID') userLogonID=value;
      other put 'NOTE: Unknown field. ' pair=;
  end;
end;
drop index pair name value ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it is complicated JSON text then convert it to a real JSON text file and use the JSON libref engine to read it. Make sure to include whatever key variables you need to merge the new dataset back to the main dataset.&lt;/P&gt;
&lt;PRE&gt;969   data _null_;
970     set;
971     put (_all_) (=/);
972   run;


string={"userCostCenter":1020,"countryCode":"CA","userMutualFundUpdateAccess"
:"true","keepAliveURL":"https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet"
,"returnURL":"https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServ
let","languageCode":"en","sessionLength":10800,"userLogonID":"TESTC35"}
userCostCenter=1020
countryCode=CA
userMutualFundUpdateAccess=true
keepAliveURL=https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet
returnURL=https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet
languageCode=en
sessionLength=10800
userLogonID=TESTC35
NOTE: There were 1 observations read from the data set WORK.TEST.
&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680857#M205873</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-02T03:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680863#M205875</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/34400"&gt;@Tal&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The below code will parse the JSON that you included in your original post.&amp;nbsp; This code has the advantage that one does not need to know the variable names beforehand.&amp;nbsp; This is somewhat unsophisticated code in that I'm not checking for embedded commas in either the variable names or the values.&amp;nbsp; If there are embedded commas, this code would have to be modified.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME	In_Data	'C:\Users\jbarbou3\Documents\SAS\Pgm\Training\JSON_Parse\JSON_Data.txt';

DATA	WORK.Parsed_Data;
	DROP	_:;

	LENGTH	_JSON_Data	$32767;
	LENGTH	_Txt_Wrk1	$1026;
	LENGTH	Var			$32;
	LENGTH	Value		$1026;
	
	INFILE	In_Data		LENGTH			=	_JSON_Length
						RECFM			=	V
						;

	INPUT	@1	_JSON_Data	$VARYING32767.	_JSON_Length;

	**	The first character is a {, so start in position 2.	**;
	_Position							=	2;

	SUBSTR(_JSON_Data, _JSON_Length, 1)	=	',';

	DO	WHILE	(_Position				&amp;lt;	_JSON_Length);
		_Segment_Length					=	INDEXC(SUBSTR(_JSON_Data, _Position), ',');
		_Txt_Wrk1						=	SUBSTR(_JSON_Data, _Position, (_Segment_Length - 1));
		Var								=	COMPRESS(SUBSTR(_Txt_Wrk1, 1, (INDEXC(_Txt_Wrk1, ':') - 1)), '"');
		Value							=	COMPRESS(SUBSTR(_Txt_Wrk1, (INDEXC(_Txt_Wrk1, ':') + 1)), '"');
		_Position						=	_Position	+	_Segment_Length;
		OUTPUT;
	END;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The above code yields the following results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JSON_Parse_Results_2020-08-31_09-05-32.jpg" style="width: 629px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48856iB8123A1E2A54651A/image-size/large?v=v2&amp;amp;px=999" role="button" title="JSON_Parse_Results_2020-08-31_09-05-32.jpg" alt="JSON_Parse_Results_2020-08-31_09-05-32.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 04:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680863#M205875</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-02T04:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680874#M205884</link>
      <description>&lt;P&gt;Well, I was thinking about this just a bit more.&amp;nbsp; If one is content with collecting a series of variable names and their values by parsing the JSON data, then my previous reply is sufficient.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if one were to desire to have the variable names become separate variable names in a SAS data set, that's a bit more involved.&amp;nbsp; There are no doubt other ways to do this, but since I rather like macros, I coded the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME	In_Data	'C:\Users\jbarbou3\Documents\SAS\Pgm\Training\JSON_Parse\JSON_Data.txt';

**------------------------------------------------------------------------------**;

DATA	WORK.Parsed_Data;
	DROP	_:;

	LENGTH	_JSON_Data	$32767;
	LENGTH	_Text_Work	$1026;
	LENGTH	_Var_Name	$32;
	LENGTH	Value		$1026;
	
	INFILE	In_Data		LENGTH			=	_JSON_Length
						RECFM			=	V
						;

	INPUT	@1	_JSON_Data	$VARYING32767.	_JSON_Length;

	**	The first character is a {, so start in position 2.	**;
	_Position							=	2;
	_Iteration							=	0;

	SUBSTR(_JSON_Data, _JSON_Length, 1)	=	',';

	DO	WHILE	(_Position				&amp;lt;	_JSON_Length);
		_Iteration						+	1;
		_Segment_Length					=	INDEXC(SUBSTR(_JSON_Data, _Position), ',');
		_Text_Work						=	SUBSTR(_JSON_Data, _Position, (_Segment_Length - 1));
		_Var_Name						=	COMPRESS(SUBSTR(_Text_Work, 1, (INDEXC(_Text_Work, ':') - 1)), '"');
		Value							=	COMPRESS(SUBSTR(_Text_Work, (INDEXC(_Text_Work, ':') + 1)), '"');
		_Position						=	_Position	+	_Segment_Length;
		IF	_N_							=	1	THEN
			CALL	SYMPUTX(CATS('Var_Name', PUT(_Iteration, F3.)), _Var_Name);
		OUTPUT;
	END;

	IF	_N_								=	1	THEN
		CALL	SYMPUTX('Var_Count', PUT(_Iteration, F3.));
RUN;

**------------------------------------------------------------------------------**;

%MACRO	List_Vars(Comma=NO);
	%IF	%QUPCASE(&amp;amp;Comma)				=	YES	%THEN
		%DO;
			%LET	Comma				=	,;
		%END;
	%ELSE
		%DO;
			%LET	Comma				=	;
		%END;

	%LOCAL	i;
	%DO	i								=	1	%TO	&amp;amp;Var_Count;
		%IF	&amp;amp;i							=	&amp;amp;Var_Count	%THEN
			%LET	Comma				=	;
		&amp;amp;&amp;amp;Var_Name&amp;amp;i &amp;amp;Comma
	%END;
%MEND	List_Vars;

**------------------------------------------------------------------------------**;

%MACRO	Equate_Vars;
	%LOCAL	i;
	%DO	i								=	1	%TO	&amp;amp;Var_Count;
		IF	_Iteration					=	&amp;amp;i	THEN
			&amp;amp;&amp;amp;Var_Name&amp;amp;i				=	Value;
	%END;
%MEND	Equate_Vars;

**------------------------------------------------------------------------------**;

DATA	WORK.Final_Data;
	DROP	Value;
	DROP	_:;
	RETAIN	_Iteration;
	RETAIN	%List_Vars;

	SET	WORK.PARSED_DATA;

	_Iteration							+	1;

	IF	_Iteration						&amp;gt;	&amp;amp;Var_Count	THEN
		_Iteration						=	1;

	%Equate_Vars;

	IF	_Iteration						=	&amp;amp;Var_Count	THEN
		DO;
			OUTPUT;
			CALL	MISSING(%List_Vars(Comma=YES));
		END;
RUN;

**------------------------------------------------------------------------------**;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The result of which is a SAS data set with column names parsed out from the JSON data:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JSON_Final_Results_2020-08-31_09-05-32.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48857i1C13D0ECF9DE2634/image-size/large?v=v2&amp;amp;px=999" role="button" title="JSON_Final_Results_2020-08-31_09-05-32.jpg" alt="JSON_Final_Results_2020-08-31_09-05-32.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This of course assumes that every iteration of the JSON data has the same set of variables.&amp;nbsp; If all the variable names are not the same, then I think the JSON files would have to be parsed into separate SAS data sets which doesn't sound very practical.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 06:11:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/680874#M205884</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-02T06:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681165#M206008</link>
      <description>&lt;P&gt;Thanks Reeza but looks like&amp;nbsp; the file needs to be a&amp;nbsp; json file&amp;nbsp; to be able to use the json&amp;nbsp; libname engine .&lt;/P&gt;
&lt;P&gt;Mine is text&amp;nbsp; with a&amp;nbsp; few json formatted fields . Tried&amp;nbsp; to convert the&amp;nbsp; file online but getting error&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 22:04:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681165#M206008</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2020-09-02T22:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681169#M206010</link>
      <description>&lt;P&gt;Thanks Tom,&lt;/P&gt;
&lt;P&gt;it turns out that the json formatted field can have different set of&amp;nbsp; variables within it so i slightly modiifed your query:&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;/*string='{"c3data":{"userCostCenter":1020,&lt;BR /&gt;"countryCode":"CA",&lt;BR /&gt;"userMutualFundUpdateAccess":"true",&lt;BR /&gt;"keepAliveURL":"&lt;A href="https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet" target="_blank"&gt;https://c3w78.sys.c3.tdgroup.com/c3/KeepAliveServlet&lt;/A&gt;",&lt;BR /&gt;"returnURL":"&lt;A href="https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet" target="_blank"&gt;https://c3w78.sys.c3.tdgroup.com/c3/DiscoveryToolTransferInServlet&lt;/A&gt;",&lt;BR /&gt;"languageCode":"en",&lt;BR /&gt;"sessionLength":10800,&lt;BR /&gt;"userLogonID":"TESTC35"}}';;*/&lt;/P&gt;
&lt;P&gt;/*string='{"CD_Q4":["C"],*/&lt;BR /&gt;/* "isExistingCustomer":"true",*/&lt;BR /&gt;/* "CD_Q2":["C"],*/&lt;BR /&gt;/* "isProfessionalStudent":"false",*/&lt;BR /&gt;/* "isN2C":"true",*/&lt;BR /&gt;/* "PSI_Q14":3,*/&lt;BR /&gt;/* "PSI_Q1A":"C",*/&lt;BR /&gt;/* "PSI_Q1B":"C",*/&lt;BR /&gt;/* "PSI_Q7":100000,*/&lt;BR /&gt;/* "PSI_Q8":10000,*/&lt;BR /&gt;/* "PSI_Q9B":100,*/&lt;BR /&gt;/* "PSI_Q2":"B",*/&lt;BR /&gt;/* "PSI_Q3":"C",*/&lt;BR /&gt;/* "PSI_Q5":"B",*/&lt;BR /&gt;/* "PSI_Q6":"C",*/&lt;BR /&gt;/* "PSI_Q12":"C",*/&lt;BR /&gt;/* "PSI_Q4":"D",*/&lt;BR /&gt;/* "CD_Q6":["NONE"],*/&lt;BR /&gt;/* "secondaryNeeds":["N2C-Package","PSI-Products"],*/&lt;BR /&gt;/* "wealthConfirmationCheckbox":"true",*/&lt;BR /&gt;/* "AdditionalQ1":"C",*/&lt;BR /&gt;/* "AdditionalQ1_Text":"test",*/&lt;BR /&gt;/* "showInterestInd":"false"}';*/&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;string='{ "TotalBorrowers":"1",&lt;BR /&gt;"CPAT_Q2":[{"borrower":"primaryBorrower",&lt;BR /&gt;"secondaryNeeds":["N2C-Package","PSI-Products"],&lt;BR /&gt;"age":67,&lt;BR /&gt;"CD_Q2":["C"],&lt;BR /&gt;"province":"ON"}]}';&lt;BR /&gt;do index=1 to countw(string,'{,}','q');&lt;BR /&gt;pair=scan(string,index,'{,}','q');&lt;BR /&gt;name=dequote(scan(pair,1,':','q'));&lt;BR /&gt;value=scan(pair,2,':','q');&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;drop index string pair;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;and am getting all variables parsed but names of variables in one&amp;nbsp; column and&amp;nbsp; their values in&amp;nbsp; the&amp;nbsp; other&amp;nbsp;which means i will have to transpose this to get the dataset i want. Transposing not an issue but along with the json formatted fields&amp;nbsp; the&amp;nbsp; text file also&amp;nbsp; has other&amp;nbsp; fields which will make&amp;nbsp; transposing difficult, So any chance&amp;nbsp; :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&lt;BR /&gt;name&amp;nbsp; &amp;nbsp;value&lt;/P&gt;
&lt;P&gt;var1&amp;nbsp; &amp;nbsp; &amp;nbsp; x&lt;/P&gt;
&lt;P&gt;var2&amp;nbsp; &amp;nbsp; &amp;nbsp; y&lt;/P&gt;
&lt;P&gt;var3&amp;nbsp; &amp;nbsp; &amp;nbsp; z&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can be switched to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var1 var2&amp;nbsp; var3&lt;/P&gt;
&lt;P&gt;x&amp;nbsp; &amp;nbsp; &amp;nbsp;y&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; z&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. to suppress /remove variables such as CPAT*,CD*,PSI*&amp;nbsp; from&amp;nbsp; the parsed&amp;nbsp; field? I dont need&amp;nbsp; those&lt;/P&gt;
&lt;P&gt;3. I am&amp;nbsp;&amp;nbsp;seeing "[","]" as names /values&amp;nbsp; in&amp;nbsp; "name" and&amp;nbsp; "value ". Can that be removed?&lt;/P&gt;
&lt;P&gt;4.["N2C-Package","PSI-Products"], should be a&amp;nbsp; value but i see&amp;nbsp;PSI-Products&amp;nbsp; under&amp;nbsp; "names"&amp;nbsp; and i am&amp;nbsp; sure this got something to do with the comma but no idea&amp;nbsp; how to&amp;nbsp; fix&amp;nbsp; it&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 22:17:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681169#M206010</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2020-09-02T22:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681170#M206011</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="trigger-hovercard" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107" target="_blank"&gt;jimbarbour&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;yea looks like the json field is not consistent in&amp;nbsp; &amp;nbsp;all the&amp;nbsp; records (different variables within)&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 22:21:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681170#M206011</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2020-09-02T22:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681171#M206012</link>
      <description>&lt;P&gt;OK.&amp;nbsp; Well, am I on the right track here?&amp;nbsp; The code above could be used to take one column out of some data, a column whose contents are JSON formatted, and create SAS variables out of them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are different variable names in another row in that same JSON formatted column, the code could be made to work, but you'd have to have some columns set to missing if not every column is coded in every row of the JSON formatted data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 22:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681171#M206012</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-02T22:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681183#M206017</link>
      <description>&lt;P&gt;actually&amp;nbsp; they just told me , they will only&amp;nbsp; want two same variables all the time from the jason field so i will use your code,&amp;nbsp; It&amp;nbsp; works . Thank you all for&amp;nbsp; you inputs . Much appreciated&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 00:07:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681183#M206017</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2020-09-03T00:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681186#M206018</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/34400"&gt;@Tal&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It was an interesting exercise, so I went ahead and wrote code that can create SAS variables based on JSON formatted data even if not all of the same variables are in each instance of JSON formatted data.&amp;nbsp; If you ever need it, here it is.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As test data, I added a few more rows.&amp;nbsp; Some of the additional rows have columns that previous rows do not.&amp;nbsp; The added columns are:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;new&lt;/LI&gt;
&lt;LI&gt;vip&lt;/LI&gt;
&lt;LI&gt;special&lt;/LI&gt;
&lt;LI&gt;promo&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Here are the results.&amp;nbsp; Note that for rows in which the JSON data did not contain a value for a given column that the value of that column is "missing".&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JSON_Parse_Results_Improved_2020-09-02_17-10-57.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48930iA8D375B161B63180/image-size/large?v=v2&amp;amp;px=999" role="button" title="JSON_Parse_Results_Improved_2020-09-02_17-10-57.jpg" alt="JSON_Parse_Results_Improved_2020-09-02_17-10-57.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the code.&amp;nbsp; I hope it comes in handy some time:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Time_Stamp(START);

**------------------------------------------------------------------------------**;

OPTIONS	VALIDVARNAME					=	V7;

%LET	Cmnt							=	;
%LET	Width							=	75;

**------------------------------------------------------------------------------**;

FILENAME	In_Data	'C:\Users\jbarbou3\Documents\SAS\Pgm\Training\JSON_Parse\JSON_Data.txt';

**------------------------------------------------------------------------------**;

DATA	WORK.Parsed_Data;
	DROP	_:;

	LENGTH	_JSON_Data	$32767;
	LENGTH	_Segment	$1026;
	LENGTH	_Var_Name	$32;
	LENGTH	Row_Nbr		4;
	LENGTH	Var_Nbr		4;
	LENGTH	Value		$1026;

	RETAIN	_Max_Nbr	0;

	IF	_N_								=	1	THEN
		DO;
			CALL	MISSING(Var_Nbr, _Var_Name);
			DECLARE	HASH	Vars(ORDERED: 'A');
			Vars.DEFINEKEY('_Var_Name');
			Vars.DEFINEDATA('Var_Nbr');
			Vars.DEFINEDONE();
		END;

	IF	_End_of_Data							THEN
		DO;
			CALL	SYMPUTX('Var_Count', PUT(_Max_Nbr, F3.), 'G');
		END;
	
	INFILE	In_Data		LENGTH			=	_JSON_Length
						RECFM			=	V
						END				=	_End_of_Data
						;

	INPUT	@1	_JSON_Data	$VARYING32767.	_JSON_Length;

	**	The first character is a {, so start in position 2.	**;
	_Position							=	2;

	SUBSTR(_JSON_Data, _JSON_Length, 1)	=	',';

	DO	WHILE	(_Position				&amp;lt;	_JSON_Length);
		_Segment_Length					=	INDEXC(SUBSTR(_JSON_Data, _Position), ',');
		_Segment						=	SUBSTR(_JSON_Data, _Position, (_Segment_Length - 1));
		_Var_Name						=	COMPRESS(SUBSTR(_Segment, 1, (INDEXC(_Segment, ':') - 1)), '"');
		Value							=	COMPRESS(SUBSTR(_Segment, (INDEXC(_Segment, ':') + 1)), '"');
		_Position						=	_Position	+	_Segment_Length;
		_RC								=	Vars.FIND();
		IF	_RC							=	0	THEN
			DO;
				CALL	SYMPUTX(CATS('Var_Name', PUT(Var_Nbr, F3.)), _Var_Name, 'G');
				IF	Var_Nbr				&amp;gt;	_Max_Nbr	THEN
					_Max_Nbr			=	Var_Nbr;
			END;
		ELSE
			DO;
				_Max_Nbr				+	1;
				CALL	SYMPUTX(CATS('Var_Name', PUT(_Max_Nbr, F3.)), _Var_Name, 'G');
				Var_Nbr					=	_Max_Nbr;
				_RC						=	Vars.ADD();
				IF	_RC					&amp;gt;	0	THEN
					DO;
						PUTLOG	"&amp;amp;Err2  ";
						PUTLOG	"&amp;amp;Err2  %Format_Dashes(&amp;amp;Width)";
						PUTLOG	"&amp;amp;Err1  |  Unable to add variable to Hash table.  "	_RC=;
						PUTLOG	"&amp;amp;Err2  %Format_Dashes(&amp;amp;Width)";
					END;
			END;
		Row_Nbr							=	_N_;
		OUTPUT;
	END;
RUN;

**------------------------------------------------------------------------------**;

&amp;amp;Cmnt.PROC	PRINT	DATA=WORK.PARSED_DATA;
&amp;amp;Cmnt.RUN;

**------------------------------------------------------------------------------**;

%MACRO	List_Vars(Comma=NO);
	%IF	%QUPCASE(&amp;amp;Comma)				=	YES	%THEN
		%DO;
			%LET	Comma				=	,;
		%END;
	%ELSE
		%DO;
			%LET	Comma				=	;
		%END;

	%LOCAL	i;
	%DO	i								=	1	%TO	&amp;amp;Var_Count;
		%IF	&amp;amp;i							=	&amp;amp;Var_Count	%THEN
			%LET	Comma				=	;
		&amp;amp;&amp;amp;Var_Name&amp;amp;i &amp;amp;Comma
	%END;
%MEND	List_Vars;

&amp;amp;Cmnt%PUT	&amp;amp;Nte1  &amp;amp;=Var_Count %List_Vars(Comma=YES);

**------------------------------------------------------------------------------**;

%MACRO	Equate_Vars;
	%LOCAL	i;
	%DO	i								=	1	%TO	&amp;amp;Var_Count;
		IF	Var_Nbr						=	&amp;amp;i	THEN
			&amp;amp;&amp;amp;Var_Name&amp;amp;i				=	Value;
	%END;
%MEND	Equate_Vars;

&amp;amp;Cmnt%PUT	&amp;amp;Nte1  %QUOTE(%Equate_Vars);

**------------------------------------------------------------------------------**;

DATA	WORK.Final_Data;
	DROP	Row_Nbr;
	DROP	Var_Nbr;
	DROP	Value;
	DROP	_:;

	RETAIN	%List_Vars;

	SET	WORK.PARSED_DATA;
		BY	Row_Nbr;

	%Equate_Vars;

	IF	LAST.Row_Nbr						THEN
		DO;
			OUTPUT;
			CALL	MISSING(%List_Vars(Comma=YES));
		END;
RUN;

**------------------------------------------------------------------------------**;

&amp;amp;Cmnt.PROC	PRINT	DATA=WORK.FINAL_DATA;
&amp;amp;Cmnt.RUN;

**------------------------------------------------------------------------------**;

%Time_Stamp(STOP);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 00:25:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/681186#M206018</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-03T00:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/789971#M252883</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;This solution looks exactly what i need for my project. However I have the json string in a column in a SAS table.&lt;/P&gt;&lt;P&gt;I'm very novice SAS Programmer.&lt;BR /&gt;Is there an easy way to modify the code. Table x has 4 columns where column 3 (JData) is the JSON string.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 12:37:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/789971#M252883</guid>
      <dc:creator>FrodeHK</dc:creator>
      <dc:date>2022-01-13T12:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/790446#M253077</link>
      <description>&lt;P&gt;Replace&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;	INFILE	In_Data		LENGTH			=	_JSON_Length
						RECFM			=	V
						END				=	_End_of_Data
						;

	INPUT	@1	_JSON_Data	$VARYING32767.	_JSON_Length;
&lt;/LI-CODE&gt;
&lt;P&gt;with&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;  set TABLENAME;
  _JSON_Data=JDATA;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jan 2022 23:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/790446#M253077</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2022-01-16T23:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/886363#M350253</link>
      <description>&lt;P&gt;Your codes are very helpful! Thanks&lt;/P&gt;&lt;P&gt;I have an issue that my JSON is in a data table with in SAS so how can I still use yours?&lt;/P&gt;&lt;P&gt;Also, my json is having this:&lt;/P&gt;&lt;P&gt;" {"Root":{"ClientDetailsArray":[&lt;/P&gt;&lt;P&gt;{"idno":"111111","genderCode":"0","Dob":"1988-08-05},&lt;/P&gt;&lt;P&gt;{"idno":"111111","genderCode":"0","Dob":"1982-03-04"},&lt;/P&gt;&lt;P&gt;{"idno":"1111111","genderCode":"0","Dob":"1982-05-27"}]}} "&lt;/P&gt;&lt;P&gt;I want the results to be this: because it is the same client but these are the dob of his family members:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;idno&lt;/TD&gt;&lt;TD&gt;genderCode&lt;/TD&gt;&lt;TD&gt;dob1&lt;/TD&gt;&lt;TD&gt;dob2&lt;/TD&gt;&lt;TD&gt;dob3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;111111&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;05-08-1988&lt;/TD&gt;&lt;TD&gt;04-03-1982&lt;/TD&gt;&lt;TD&gt;27-05-1982&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 26 Jul 2023 09:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parsing-JSON-data/m-p/886363#M350253</guid>
      <dc:creator>NerdAct77</dc:creator>
      <dc:date>2023-07-26T09:46:49Z</dc:date>
    </item>
  </channel>
</rss>

