I want to learn how to export html files to our organization's website. Is this the documentation I should use?
https://documentation.sas.com/api/docsets/pcfsicg/9.4/content/pcfsicg.pdf?locale=en
Quick question, your subject says importing/exporting CSV files but your question says exporting HTML. I answered them both, I wasn't sure which you wanted.
1. If you want to import/export CSV files the easiest is to proc import and proc export
Quick example of proc import
proc import datafile="Location/of/file.csv"
dbms=csv
out=SASoutputTableName/*Creates the SAS table from the CSV file*/
replace /*If out table exists replace it*/;
/*More statements you can use (optional). See documentation*/
getnames=;/*Yes or No*/
guessingrows=;/*Used to guess the column type and length*/
run;
2. If you are looking to export to an html file look at ODS html. ODS HTML Documentation
Quick example for a sample SAS table you should have
ods html body="C:\Where\You\Want\The\HTMLFile\Testfile.html"/*<--Change this location*/ style=htmlblue;
proc means data=sashelp.cars;
var mpg_city;
class type;
run;
ods html close;
Quick question, your subject says importing/exporting CSV files but your question says exporting HTML. I answered them both, I wasn't sure which you wanted.
1. If you want to import/export CSV files the easiest is to proc import and proc export
Quick example of proc import
proc import datafile="Location/of/file.csv"
dbms=csv
out=SASoutputTableName/*Creates the SAS table from the CSV file*/
replace /*If out table exists replace it*/;
/*More statements you can use (optional). See documentation*/
getnames=;/*Yes or No*/
guessingrows=;/*Used to guess the column type and length*/
run;
2. If you are looking to export to an html file look at ODS html. ODS HTML Documentation
Quick example for a sample SAS table you should have
ods html body="C:\Where\You\Want\The\HTMLFile\Testfile.html"/*<--Change this location*/ style=htmlblue;
proc means data=sashelp.cars;
var mpg_city;
class type;
run;
ods html close;
Thanks. My title must have been an autofill.
I forgot to mention, if you want to review proc import and the ODS statement take a look at the free SAS Programming 1 Essentials e-learning course. Proc import is taught in chapter 2 "Accessing Data", and in chapter 6 "Exporting Data" the ODS statement is taught.
SAS Programming 1: Essentials - Scroll to where it says Self-Paced e-Learning and it should say free. Click start and review the entire course or the chapters you need!
- Peter
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.