SASEWBGO Interface Engine

Example 54.8 Retrieving Quarterly External Debt Statistics for Multiple Countries

(View the complete code for this example.)

This example demonstrates how to retrieve quarterly external debt statistics (SDDS database) for multiple countries.

title 'Retrieve Quarterly External Debt Statistics';
options validvarname=any;
libname wbgo sasewbgo "%sysget(WBGO)"
   countrylist='aus;gbr;usa'
   idlist='DT.DOD.DSTM.CD.GG.AR.US,DT.DOD.DECT.CD.GG.AR.US,DT.DOD.DSTC.CD.GG.AR.US,
           DT.DOD.DSCD.CD.GG.AR.US'
   range='2014Q2:2016Q3'
   outxml=debtext
   AUTOMAP=replace
   MAPREF=MyMap
   XMLMAP="%sysget(WBGO)debtext.map"
   ;

data mydebtext;
   set wbgo.debtext;
run;
proc contents data=mydebtext; run;
proc print data=mydebtext(drop=total_count); run;

Output 54.8.1: Retrieving Quarterly External Debt Statistics for RANGE=2014Q2:2016Q3

Retrieve Quarterly External Debt Statistics

Obs country_id date country DT.DOD.DSTM.CD.GG.AR.US DT.DOD.DECT.CD.GG.AR.US DT.DOD.DSTC.CD.GG.AR.US DT.DOD.DSCD.CD.GG.AR.US
1 AUS 2014Q2 Australia 877943996.271997 230884199019.599 878885996.267997 0
2 AUS 2014Q3 Australia 732542399.999998 221594513599.999 733417599.999998 0
3 AUS 2014Q4 Australia 405999000 219181225800 406819200 0
4 AUS 2015Q1 Australia 799279800.000002 216317787400.001 800806600.000002 0
5 AUS 2015Q2 Australia 989952000.000003 210507264000.001 990720000.000003 0
6 AUS 2015Q3 Australia 2361669000 202583392000 2362370000 0
7 AUS 2015Q4 Australia 1569328800 209967134000.001 1571520600 0
8 AUS 2016Q1 Australia 1451767200 222840139600 1452532900 0
9 AUS 2016Q2 Australia 765620600 217050841000 765620600 0
10 AUS 2016Q3 Australia 861427000.000001 227235134000 861427000.000001 0
11 GBR 2014Q2 United Kingdom 35603150000 769223942500 38018713000 338996500
12 GBR 2014Q3 United Kingdom 43396378000 778274180000 46828156000 341398000
13 GBR 2014Q4 United Kingdom 42427226400 725384921600 46649190400 273140000
14 GBR 2015Q1 United Kingdom 44417760000 718726480000 49173000000 282680000
15 GBR 2015Q2 United Kingdom 52587712600 761210165600 59542927600 342652400
16 GBR 2015Q3 United Kingdom 52217684400 766756112200 64770538500 352616800
17 GBR 2015Q4 United Kingdom 59665739700 787293458700 72044050400 280079100
18 GBR 2016Q1 United Kingdom 53548913700 781558630800 65962859400 286619700
19 GBR 2016Q2 United Kingdom 52640966400 793917168000 65619120000 315619200
20 GBR 2016Q3 United Kingdom 63788857600 804406319600 79094502500 356427500
21 USA 2014Q2 United States 627915000000 6112395000000 627915000000 0
22 USA 2014Q3 United States 614327000000 6184334000000 614327000000 0
23 USA 2014Q4 United States 671935000000 6223507000000 671935000000 0
24 USA 2015Q1 United States 702602000000 6346408000000 702602000000 .
25 USA 2015Q2 United States 701641000000 6283783000000 701641000000 .
26 USA 2015Q3 United States 667370000000 6199521000000 667370000000 .
27 USA 2015Q4 United States 724796000000 6304108000000 724796000000 .
28 USA 2016Q1 United States 727083000000 6375345000000 727083000000 .
29 USA 2016Q2 United States 688341000000 6271108000000 688341000000 0
30 USA 2016Q3 United States 699171000000 6195926000000 699171000000 0


Output 54.8.1 shows the results for all three countries listed in the COUNTRYLIST= option. Four time series are specified in the IDLIST= option. The sort order of the observations defaults to ascending dates within each country’s cross section of data.

Last updated: June 19, 2025