EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials SAS Tutorial SAS ODS
Secondary Sidebar
SAS Tutorial
  • Basic
    • What is SAS
    • Advantages of SAS
    • Career in SAS
    • SAS Command
    • SAS Operators
    • SAS Export to CSV
    • Loops in SAS
    • DO WHILE in SAS
    • SAS System Interview Questions
    • SSAS Interview Questions
    • SAS Visual Analytics
    • SAS Join
    • SAS Length
    • SAS INTNX
    • SAS Congruence
    • SAS LAG Function
    • SAS boxplot
    • SAS INTCK
    • SAS Find
    • SAS Grid
    • SAS Triangle Calculator
    • SAS KEEP
    • SAS YEAR Function
    • SAS Format
    • SAS Libname
    • SAS Rename
    • SAS Retain
    • SAS Base
    • SAS JMP
    • SAS Array
    • SAS Round
    • SAS DO Loop
    • SAS Index
    • SAS Datalines
    • SAS Model
    • SAS Logistic Regression
    • SAS Numeric to Character
    • SAS Label
    • SAS ODS
    • SAS Upcase
    • SAS Numeric Formats
    • SAS Nodupkey

SAS ODS

Introduction to SAS ODS

SAS ODS is the output delivery system that helps produce the output format in the SAS data program to understand the ideas and data reports with additional platform support on multiple PROC statements in the file through different parameters called path representing the html output cases in other filename paths data style is an additional parameter for the default set of styles that represented in SAS environment.

SAS ODS

Key Takeaways

  • SAS ODS denoted the SAS OUTPUT DELIVERY SYSTEM.
  • It is more user-friendly with the html, pdf, and RTF word document formats.
  • So it will produce friendly data reports with accuracy and customized data view pattern for user understanding.
  • It also shared the same output format with other Operating System Environments and Software.
  • Multiple Proc statements help perform as a single file.

What is SAS ODS?

The SAS output delivery system helps to convert the data format like .html, pdf, etc., which helps to restore most of the areas in the SAS platform. It has two sets of parameters like, Path and Style; here, the path represents html set of input codes that get the appropriate output result cases, including the filename already saved with the .html format in the user location. Then the style represents the default set of methods available in the SAS environment on the proc set of SQL statements captured in the input file. The SAS dataset will be created accordingly to the ODS output statements with required output objects viewed by the record, and the same will be printed on the output console.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

How to Use SAS ODS?

Using ODS, the html statement will create the file with an extension called .html format on the desired path based on the user inputs datasets output is produced, and the same will be consumed on the printed screen. It supports other extensions like pdf and word(TRF) format in the RTF file path across the data collections from the default procedure on the tools like ODS TRACE, ODS OUTPUT, SAS metadata, etc. These are some essential tools for printing the datas in the SAS environment. The SAS Graphics editor and other reporting procedures are buried with the procedural output on the demonstration that is exactly queried to retrieve the information.

Syntax of SAS ODS

Below code is the basic syntax for the formats:

ods html file='';
path="";
style="";
proc sql;
select column name1, column name2,… from table name conditional statements orders;
quit;
ods html close;

The above codes are performed like Output Delivery System to access and convert the file systems.

We used HTML, PDF, and RTF formats, extensions, and various areas here.

Steps for Creating SAS ODS

Given below are the steps mentioned:

1. Navigate to the below URL and log in to the issue.

2. https://odamid-apse1-2.oda.sas.com/SASStudio/main?locale=en_US&zone=GMT%252B05%253A30&ticket=ST-21997-zc7hRX6saecoTMyhQRpP-cas

3. Then paste the below code for generating the ODS in html format.

4. ODS HTML

5. PATH = ‘/home/u61573544/August5’

6. FILE = ‘August5.html’

7. STYLE = EGDefault;

8. proc SQL;

9. select ID, SEGMENT, DENSITY

10. from MAPSSAS.INDIA

11. where ID in (1,6)

12. Order by ID;

13. quit;

14. ODS HTML CLOSE;

SAS ODS 1

SAS ODS 2

15. We get the above results with the columns like GLC: Province Number, Country Segment Number, and Levels for Reducing.

GLC:Province Number, Country Segment Number and Levels

16. The condition is only satisfied with this query.

17. select ID, SEGMENT, DENSITY

18. from MAPSSAS.INDIA

19. where ID in (1,6)

20. Order by ID;

21. And we get an output file with html format on the specified location like below.

output file with html format on the specified location

SAS ODS 5

22. When we double-click a file, it is downloaded, and we can view it through the browser.

double click the file and its downloaded

How to Create HTML and PDF Output?

The Data step and ODS will help create HTML and PDF reports in the default data table template to perform the user operations. Additionally, it will help write the output object to the HTML destination and the PDF format if the user input conversion is pdf.

Example #1

Example for creating HTML Output using SAS ODS.

Code:

ODS HTML
PATH = '/home/u61573544/August5'
FILE = 'August61.html'
STYLE = EGDefault;
proc SQL;
select AMOUNT, DATE
from SASHELP.BUY
where AMOUNT in (-1000,-4000)
Order by AMOUNT;
quit;
ODS HTML CLOSE;

Output:

creating HTML Output using SAS ODS

The above code is the basic workflow of the SAS ODS in the html format Output Display System. We can initialize the ODS HTML format at the beginning of the code and then specify the PATH, FILE, and STYLE with appropriate values. Then we can call the required table from the dataset with an output format like an HTML file.

Example #2

Example for creating PDF Output using SAS ODS.

Code:

ODS PDF
FILE = 'https://cdn.educba.com/home/u61573544/SASPDFAugust6/August61.pdf'
STYLE = EGDefault;
proc SQL;
select AMOUNT, DATE
from SASHELP.BUY
where AMOUNT in (-1000,-4000)
Order by AMOUNT;
quit;

Output:

creating PDF Output using SAS ODS

The above example which same as the first example with html format output. Here we need to convert the data format by using the PDF view. We can use the same table with data and orders along with the FILE and STYLE paths.

Frequently Asked Questions

Other FAQs are mentioned below:

Q1. What is SAS ODS?

Answer:

It is one type of conversion in SAS and stands for output delivery system. So it delivers using the ODS keyword, which is available in the SAS.

Q2. What are the formats supported in SAS ODS?

Answer:

Currently, it supports html, pdf, and RTF formats.

Q3. How will you convert the SAS ODS to the HTML format?

Answer:

  • Using ODS HTML
  • Specified PATH=’’
  • FILE=’name.html’
  • STYLE= “”;

Q4. How will we convert the SAS ODS to PDF format?

Answer:

  • Using ODS PDF
  • FILE=”PATH”
  • STYLE=”name”

Q5. How will it support the SAS ODS to RTF format?

Answer:

  • Using ODS RTF
  • FILE=’path along with filename.rtf’
  • STYLE=”name”

Conclusion

The SAS ODS excludes the specific datas that may include source and destination parts. It also sets the default value, excludes ALL with other data lists, and sets it as the default value. It mainly focused on overcoming the data limitation compared to the standard SAS output.

Recommended Articles

This is a guide to SAS ODS. Here we discuss the introduction, examples, and steps for creating SAS ODS with FAQ. You may also have a look at the following articles to learn more –

  1. SAS boxplot
  2. SAS INTNX
  3. SAS LAG Function
  4. SAS Congruence
Popular Course in this category
SAS Training (9 Courses, 10+ Projects)
  9 Online Courses |  10 Hands-on Projects |  123+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

Data Visualization Training (15 Courses, 5+ Projects)4.9
Business Intelligence Training (12 Courses, 6+ Projects)4.8
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more