Published on :
ETL EXTERNAL

CSV Data Import and Verification

This code is also available in: Deutsch Español Français
Awaiting validation
The first block uses `PROC IMPORT` to read a CSV file located at `/folders/myshortcuts/EPG194/data/np_traffic.csv`. The file is imported using the `dbms=csv` engine and saved under the table name `traffic`. The `replace` option ensures that the table is recreated if it already exists. The `guessingrows=max` option allows SAS© to analyze a maximum number of rows to determine variable types and lengths, ensuring better import quality. The second block uses `PROC CONTENTS` to display the metadata of the newly created `traffic` table. This includes information such as the number of observations, variables, their types, and formats, which is useful for verifying the integrity and structure of the imported data.
Data Analysis

Type : EXTERNAL


The script imports data from an external CSV file (`/folders/myshortcuts/EPG194/data/np_traffic.csv`).

1 Code Block
PROC IMPORT Data
Explanation :
This block imports an external CSV file into a SAS dataset. `datafile` specifies the path to the source file. `dbms=csv` indicates the file type. `out=traffic` names the output SAS dataset. `replace` overwrites an existing dataset. `guessingrows=max` optimizes column type detection by analyzing all rows.
Copied!
1PROC IMPORT datafile="/folders/myshortcuts/EPG194/data/np_traffic.csv"
2 dbms=csv
3 out=traffic
4 replace;
5 guessingrows=max;
6RUN;
2 Code Block
PROC CONTENTS
Explanation :
This block generates a report on the metadata of the `traffic` dataset, including the list of variables, their types, lengths, and formats. This is a standard verification step after data import to ensure the correct structure and loading of the data.
Copied!
1PROC CONTENTS DATA=traffic;
2RUN;
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.