Help using Base SAS procedures

PROC IMPORT from Web

Accepted Solution Solved
Reply
SAS Employee
Posts: 89
Accepted Solution

PROC IMPORT from Web

Ok,

I need some help.  I need to import this dataset to a SAS dataset and I want to use as few a lines of code as possible. I would rather not write a data step to read it it.  Can i use PROC IMPORT?

"https://research.stlouisfed.org/econ/mccracken/fred-databases/monthly/current.csv"

Who can do it?

Thanks-Ken


Accepted Solutions
Solution
‎08-24-2015 06:37 PM
Trusted Advisor
Posts: 1,300

Re: PROC IMPORT from Web

filename csvFile url "https://research.stlouisfed.org/econ/mccracken/fred-databases/monthly/current.csv" termstr=crlf;

proc import datafile=csvFile out=foo replace dbms=csv; run;

View solution in original post


All Replies
Respected Advisor
Posts: 4,649

Re: PROC IMPORT from Web

Use PROC HTTP:

/* Set destination fileref */

filename csvFile "&sasforum.\datasets\current.csv";

/* Get file */

proc http method="get" out=csvFile url="https://research.stlouisfed.org/econ/mccracken/fred-databases/monthly/current.csv";

run;

filename csvFile;

Works for me.

PG

PG
Solution
‎08-24-2015 06:37 PM
Trusted Advisor
Posts: 1,300

Re: PROC IMPORT from Web

filename csvFile url "https://research.stlouisfed.org/econ/mccracken/fred-databases/monthly/current.csv" termstr=crlf;

proc import datafile=csvFile out=foo replace dbms=csv; run;

SAS Employee
Posts: 89

Re: PROC IMPORT from Web

thanks to both of you.  they both work great.  -Ken

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 352 views
  • 4 likes
  • 3 in conversation