<?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 put _infile_ data into a sas dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/put-infile-data-into-a-sas-dataset/m-p/425750#M104883</link>
    <description>&lt;P&gt;I am reading data from an API. I get the following response&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[
{
  "id": "0a3f50a4-dea6-32b8-e044-0003ba298018",
  "status": 1,
  "vejkode": "1723",
  "vejnavn": "**bleep**otvej",
  "adresseringsvejnavn": "**bleep**otvej",
  "husnr": "70",
  "etage": null,
  "dÃ¸r": null,
  "supplerendebynavn": null,
  "postnr": "2730",
  "postnrnavn": "Herlev",
  "kommunekode": "0163",
  "adgangsadresseid": "0a3f507c-788b-32b8-e044-0003ba298018",
  "x": 12.43946822,
  "y": 55.7150554
}
]&lt;/PRE&gt;&lt;P&gt;Is there a easy way to convert this to a sas data set?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Minimal working example below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename src temp;
proc http
 method="GET"
 url='https://dawa.aws.dk/adresser?vejnavn=**bleep**otvej&amp;amp;husnr=70&amp;amp;postnr=2730&amp;amp;struktur=mini'
 out=src;
run;


data test2;
   infile src;
   input ;

   put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 08 Jan 2018 13:07:59 GMT</pubDate>
    <dc:creator>rudfaden</dc:creator>
    <dc:date>2018-01-08T13:07:59Z</dc:date>
    <item>
      <title>put _infile_ data into a sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-infile-data-into-a-sas-dataset/m-p/425750#M104883</link>
      <description>&lt;P&gt;I am reading data from an API. I get the following response&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[
{
  "id": "0a3f50a4-dea6-32b8-e044-0003ba298018",
  "status": 1,
  "vejkode": "1723",
  "vejnavn": "**bleep**otvej",
  "adresseringsvejnavn": "**bleep**otvej",
  "husnr": "70",
  "etage": null,
  "dÃ¸r": null,
  "supplerendebynavn": null,
  "postnr": "2730",
  "postnrnavn": "Herlev",
  "kommunekode": "0163",
  "adgangsadresseid": "0a3f507c-788b-32b8-e044-0003ba298018",
  "x": 12.43946822,
  "y": 55.7150554
}
]&lt;/PRE&gt;&lt;P&gt;Is there a easy way to convert this to a sas data set?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Minimal working example below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename src temp;
proc http
 method="GET"
 url='https://dawa.aws.dk/adresser?vejnavn=**bleep**otvej&amp;amp;husnr=70&amp;amp;postnr=2730&amp;amp;struktur=mini'
 out=src;
run;


data test2;
   infile src;
   input ;

   put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jan 2018 13:07:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-infile-data-into-a-sas-dataset/m-p/425750#M104883</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2018-01-08T13:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: put _infile_ data into a sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-infile-data-into-a-sas-dataset/m-p/425764#M104886</link>
      <description>&lt;P&gt;That is a JSON file.&amp;nbsp; You can get a lot of inforamtion for googling SAS read json file:&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;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Reading-json-file-into-SAS-using-SAS-enterprise-guide/td-p/205044" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Reading-json-file-into-SAS-using-SAS-enterprise-guide/td-p/205044&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 14:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-infile-data-into-a-sas-dataset/m-p/425764#M104886</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-08T14:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: put _infile_ data into a sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-infile-data-into-a-sas-dataset/m-p/425771#M104888</link>
      <description>&lt;P&gt;And if you're not at the required maintenance level for the JSON libname engine already, this code (after expansion of the select() block) will also do it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test2;
infile src truncover;
length input_line $100;
length
  id $36
  status 3
  veikode $4
  vejnavn $20
  adresseringsvejnavn $20
  husnr $10
  etage $10
  door $10
  supplerendebynavn $10
  postnr $4
  postnrnavn $20
  kommunekode $4
  adgangsadresseid $36
  x y 8
;
retain
  id
  status
  veikode
  vejnavn
  adresseringsvejnavn
  husnr
  etage
  door
  supplerendebynavn
  postnr
  postnrnavn
  kommunekode
  adgangsadresseid
  x y 
;
input input_line $100.;
select (compress(scan(input_line,1,':'),'"'));
  when ('{','}');
  when ('[') do;
    id = "";
    status = .;
    veikode = "";
    vejnavn = "";
    adresseringsvejnavn = "";
    husnr = "";
    etage = "";
    door = "";
    supplerendebynavn = "";
    postnr = "";
    postnrnavn = "";
    kommunekode = "";
    adgangsadresseid = "";
    x = .;
    y = .;
  end;
  when (']') output;
  when ('id') id = compress(scan(input_line,2,':'),'"');
  otherwise;
end;
drop input_line;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jan 2018 14:48:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-infile-data-into-a-sas-dataset/m-p/425771#M104888</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-08T14:48:05Z</dc:date>
    </item>
  </channel>
</rss>

