BookmarkSubscribeRSS Feed
BruceBrad
Lapis Lazuli | Level 10

Any suggestions on the best way to import data from the ABS SDMX-json interface? I believe they use the same format as the OECD, but the SASEOECD engine doesn't allow the use of non-OECD websites. An example access url is below. This is for the population aged 0-4 in 2018Q1.

https://stat.data.abs.gov.au/sdmx-json/data/ERP_QUARTERLY/1.0.3.A04.Q/all?detail=Full&dimensionAtObs...

 

 

5 REPLIES 5
BruceBrad
Lapis Lazuli | Level 10
Can a mod move this into a better forum? (I started by thinking SASEOECD was a procedure).
Ksharp
Super User
If it is a JSON file . Why not use JSON engine of LIBNAME ?
BruceBrad
Lapis Lazuli | Level 10

I wasn't aware of the JSON engine. I'll look into it and report back. Thanks.

BruceBrad
Lapis Lazuli | Level 10

Returning to this problem. I have the (perhaps mistaken) guess that the solution to this should be simple. Below is my most recent attempt using the xml engine. I get an error message saying an xmlmap might be required. How do I create this? The data structure is very simple (the https file can be opened in a browser).

%let url = https://api.data.abs.gov.au/data/CPI/1.10001.10.1.Q/all?startPeriod=2019;
filename in url "&url" debug;
libname in xml xmltype=generic;
data temp;
  set in.series;
run;
BruceBrad
Lapis Lazuli | Level 10

This code runs. It returns a set of files which I would have to merge together to get the basic data table I'm after. Has this reassembly process been packaged into a procedure or macro for data in the SDMX format?

 

%let url = https://api.data.abs.gov.au/data/CPI/1.10001.10.1.Q/all?startPeriod=2019;
filename temp1 "%sysget(TEMP)\temp1.txt";
filename map "%sysget(TEMP)\temp.map";

proc http url="&url" out=temp1;run;

libname temp1 xmlv2 automap=replace xmlmap=map;

proc copy in=temp1 out=work;run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1906 views
  • 0 likes
  • 2 in conversation