<?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: how to export Nested JSON with proc JSON? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820616#M81898</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3480"&gt;@BillM_SAS&lt;/a&gt;&amp;nbsp;, the code seems to work. I just need to tweak them a bit further to get to how we want the json file format to be.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jun 2022 00:52:06 GMT</pubDate>
    <dc:creator>jsut</dc:creator>
    <dc:date>2022-06-28T00:52:06Z</dc:date>
    <item>
      <title>how to export Nested JSON with proc JSON?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820191#M81888</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm pretty new with trying to export json file from sas.&lt;/P&gt;&lt;P&gt;Can I please get some help on how to export a nested json with proc json? Thanks in advance.&lt;/P&gt;&lt;P&gt;So, what I'm trying to get is something like:&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;{"person_id": "12345",&lt;BR /&gt;"timestamp":"Tue Jun 7 07:21:50 2022",&lt;BR /&gt;"message":"sample",&lt;BR /&gt;"items":[&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{"category_type":"cat1",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"category_status":"approved",&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"details": [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{"subcategory_code":"subcat1",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"subcategory_total":100}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;,{"subcategory_code":"subcat2",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"subcategory_total":50&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{"category_type":"cat2",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"category_status":"pending",&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"details": [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{"subcategory_code":"subcat1",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"subcategory_total":200}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;,{"subcategory_code":"subcat2",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"subcategory_total":300}&lt;/P&gt;&lt;P&gt;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;]&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;{"person_id": "56789",&lt;BR /&gt;"timestamp":"Tue Jun 7 07:21:50 2022",&lt;BR /&gt;"message":"sample",&lt;BR /&gt;"items":[&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{"category_type":"cat3",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"category_status":"pending",&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"details": [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{"subcategory_code":"subcat1",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"subcategory_total":10}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;,{"subcategory_code":"subcat2",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"subcategory_total":20}&lt;/P&gt;&lt;P&gt;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{"category_type":"cat4",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"category_status":"approved",&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"details": [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{"subcategory_code":"subcat1",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"subcategory_total":30}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;,{"subcategory_code":"subcat2",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"subcategory_total":50}&lt;/P&gt;&lt;P&gt;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ]&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 06:00:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820191#M81888</guid>
      <dc:creator>jsut</dc:creator>
      <dc:date>2022-06-24T06:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to export Nested JSON with proc JSON?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820197#M81889</link>
      <description>&lt;P&gt;Why do you want to create a json file using sas?&lt;/P&gt;
&lt;P&gt;Can you post the datasets in usable form (dataset with datalines)?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 06:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820197#M81889</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-06-24T06:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to export Nested JSON with proc JSON?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820203#M81890</link>
      <description>&lt;P&gt;You can use the PROC JSON, probably with the NOSASTAGS and PRETTY options:&lt;BR /&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n0nejfk9q0pzmnn181l92qk3ah2e.htm" target="_blank" rel="noopener"&gt;proc JSON documentation&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Alternatively, you can compose it manually with a date step,&lt;BR /&gt;as shown in this other post:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/Proc-JSON-Export-Nested-JSON/td-p/813357" target="_blank" rel="noopener"&gt;JSON export post&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 08:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820203#M81890</guid>
      <dc:creator>V_Altomonte</dc:creator>
      <dc:date>2022-06-24T08:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to export Nested JSON with proc JSON?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820412#M81896</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;we're planning to automate some process using data from sas to be then pushed into another system that's expecting a json file.&lt;/P&gt;&lt;P&gt;some sample datasets as below:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;data sampledata;&lt;BR /&gt;input person_id $5.&lt;BR /&gt;person_name $10.&lt;BR /&gt;message $10.&lt;BR /&gt;category_type $5.&lt;BR /&gt;category_status $8.&lt;BR /&gt;subcategory_code $10.&lt;BR /&gt;subcategory_total 5.;&lt;/P&gt;&lt;P&gt;datalines;&lt;BR /&gt;12345 Person_A Sample_1 cat1 approved subcat1 100&lt;BR /&gt;12345 Person_A Sample_1 cat1 approved subcat2 50&lt;BR /&gt;12345 Person_A Sample_1 cat2 pending subcat1 200&lt;BR /&gt;12345 Person_A Sample_1 cat2 pending subcat2 300&lt;BR /&gt;56789 Person_Z Sample_2 cat3 pending subcat1 10&lt;BR /&gt;56789 Person_Z Sample_2 cat3 pending subcat2 20&lt;BR /&gt;56789 Person_Z Sample_2 cat4 approved subcat1 30&lt;BR /&gt;56789 Person_Z Sample_2 cat4 approved subcat2 50&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jun 2022 03:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820412#M81896</guid>
      <dc:creator>jsut</dc:creator>
      <dc:date>2022-06-26T03:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to export Nested JSON with proc JSON?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820556#M81897</link>
      <description>&lt;P&gt;I previously posted a &lt;A href="https://communities.sas.com/t5/SAS-Programming/PROC-JSON-create-a-hierarchical-file/m-p/413679#M101279" target="_self"&gt;proof-of-concept SAS program&lt;/A&gt; that produces hierarchical output using PROC JSON. You should be able to use this as a starting point to produce what you want as output.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 17:40:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820556#M81897</guid>
      <dc:creator>BillM_SAS</dc:creator>
      <dc:date>2022-06-27T17:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to export Nested JSON with proc JSON?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820616#M81898</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3480"&gt;@BillM_SAS&lt;/a&gt;&amp;nbsp;, the code seems to work. I just need to tweak them a bit further to get to how we want the json file format to be.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 00:52:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-export-Nested-JSON-with-proc-JSON/m-p/820616#M81898</guid>
      <dc:creator>jsut</dc:creator>
      <dc:date>2022-06-28T00:52:06Z</dc:date>
    </item>
  </channel>
</rss>

