Published on :
ETL EXTERNAL

Download and Import Titanic Data

This code is also available in: Deutsch Español Français
Awaiting validation
The script performs an HTTP GET request to download the 'titanic3.csv' file from Vanderbilt University's data repository. The file is saved to a temporary reference, then the IMPORT procedure is used to transform this CSV into a SAS© dataset named 'titanic'.
Data Analysis

Type : EXTERNAL


The data comes from an external web source (URL biostat.mc.vanderbilt.edu) and is retrieved dynamically during execution.

1 Code Block
PROC HTTP Data
Explanation :
Declaration of a temporary file and download of the remote CSV file via the HTTP procedure.
Copied!
1filename DATA temp;
2PROC HTTP
3 url="http://biostat.mc.vanderbilt.edu/wiki/pub/Main/DataSets/titanic3.csv"
4 method="GET"
5 out=DATA;
6RUN;
2 Code Block
PROC IMPORT Data
Explanation :
Conversion of the downloaded CSV file into a local SAS table named 'titanic'.
Copied!
1PROC IMPORT out=titanic
2 datafile=DATA
3 dbms=csv
4 replace;
5RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.