Write and run SAS programs in your web browser

SASEFRED Interface Engine with SAS studio

Reply
Occasional Contributor
Posts: 5

SASEFRED Interface Engine with SAS studio

[ Edited ]

I executed the following SAS program (using The SASEFRED Interface Engine) to extract the data from FRED (St Louis Fed website)

 

options validvarname=any;

title 'Retrieve Data for the Exports of Goods and Services';

libname _all_ clear; libname fred sasefred "%sysget(FRED)"

OUTXML=exportgs

XMLMAP="%sysget(FRED)exportgs.map"

APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

IDLIST='bopxgsa';

 

data export_gsa;

set fred.exportgs ;

run;

 

proc contents data=export_gsa;

run; proc print data=export_gsa(obs=15); run

 

then I have the following error messages:

 

Error: Invalid physical name library name FRED

Error: Error in the LIBNAME statement.

Error: Libref FRED is not assigned.

 

How can I fix these problems?

 

Grand Advisor
Posts: 10,211

Re: SASEFRED Interface Engine with SAS studio

Do you have your own FRED API key? are you sure it was set up correctly?

Occasional Contributor
Posts: 5

Re: SASEFRED Interface Engine with SAS studio

yes, I have my own FRED API key. I just did not put it there.

 

Respected Advisor
Posts: 3,063

Re: SASEFRED Interface Engine with SAS studio

In addition to @ballardw'd comment, check that the environment variable FRED is defined by adding:

 

%put FRED = &FRED;

to your program. By the look of it FRED is a directory where your XML mapping file is stored.

Occasional Contributor
Posts: 5

Re: SASEFRED Interface Engine with SAS studio

Where do i insert this program? Can you show me here?

 

 

Respected Advisor
Posts: 3,063

Re: SASEFRED Interface Engine with SAS studio

At the end is fine.

Ask a Question
Discussion stats
  • 5 replies
  • 245 views
  • 0 likes
  • 3 in conversation