ODS DOCUMENT and PROC DOCUMENTTip Tip Sheet ODS DOCUMENT and PROC DOCUMENT Sheet ODS Document and Proc Document Tip Sheet ODS DOCUMENT and PROC DOCUMENT Tip Sheet PROCDOCUMENT DOCUMENT PROC (Continued) (Continued) PROC DOCUMENT (Continued) EntryManagement Management Statements Entry Statements Entry Management Statements copypath-1, path-1,…, …,path-m path-mtotopath-n; path-n; copy Copies path-1, …,path-m path-m topath-n path-n Copies path-1, copy path-1, …,…, path-m to to path-n; Copies path-1, …, path-m to path-n movepath-1, path-1,…, …,path-m path-mtotopath-n; path-n; move Moves path-1, …, path-m to path-n Moves path-1, …, path-m to path-n move path-1, …, path-m to path-n; Moves path-1, …, path-m to path-n makepath-1, path-1,…, …,path-n; path-n; make Creates new directories namedpath-1, path-1,…, …,path-n path-n Creates new directories make path-1, …, path-n;named Creates new directories named path-1, …, path-n importdata=data-set-name data=data-set-nametotopath; path; import import grseg=grseg-nametoto topath; path; import grseg=grseg-name import data=data-set-name path; Imports dataset, set,data-set-name, data-set-name, grseg,grseggrsegImports data ororgrseg, import grseg=grseg-name to path; name,todata topath, path, respectively or grseg, grsegname, Imports set,respectively data-set-name, name, to path, respectively notepath path“text”; “text”; note Creates a new noteatatpath path Creates a new note note path “text”; Creates a new note at path linkpath-1 path-1totopath-2; path-2; link Creates a symbolic linkfrom frompath-1 path-1totopath-2 path-2 Creates a symbolic link link path-1 to path-2; Creates a symbolic link from path-1 to path-2 renamepath-1 path-1totopath-2; path-2; rename Renames path-1 topath-2 path-2 Renames path-1 rename path-1 totopath-2; Renames path-1 to path-2 setlabelpath path“text”; “text”; setlabel Setsthe thepath label path Sets label ofofpath setlabel “text”; Sets the label of path deletepath-1, path-1,…, …,path-n; path-n; delete Deletes path-2, …, path-n Deletes path-2, …, path-n delete path-1, …, path-n; Deletes path-2, …, path-n obbnotepath path“text”; “text”; obbnote obanote path “text”; obanote path “text”; obbnote path “text”; obtitlepath path“text”; “text”; obtitle obanote path “text”; obstitle path “text”; obstitle path “text”; obtitle path “text”; obfootn path “text”; obfootn path “text”; obstitle path “text”; Setsthe thenthnthbefore before note,after afternote, note,title, title,subtitle, subtitle,oror Sets note, obfootn path “text”; thof footnote path,respectively respectively nostring string footnote path, IfIfnotitle, isis or Sets the nof before note, after note, subtitle, specified, the note, title, or footnote is deleted specified, the note, title, or footnote is deleted footnote of path, respectively If no string is specified, the note, title, or footnote is deleted obpagepath path; obpage Controls page breaks The afteroption optioncontrols controls Controls page breaks The after obpage path ; page breaks after path The delete option deletes page breaks after path The delete option deletes Controls page breaks The after option controls page breaks from path page breaks from path page breaks after path The delete option deletes page breaks from path Example Example Example Createa anew newdocument; document; * *Create odsdocument documentname=mydocument(write); name=mydocument(write); ods * Create a new document; ods document name=mydocument(write); Runprocedures; procedures; * *Run proccontents contentsdata=sashelp.class; data=sashelp.class;run; run; proc * Run procedures; proc contents data=sashelp.class; run; Closethe thedocument documentdestination; destination; * *Close odsdocument documentclose; close; ods * Close the document destination; ods document close; Modifyand andreplay replaythe thedocument; document; * *Modify procdocument documentname=mydocument; name=mydocument; proc * Modify and replay the document; proc document name=mydocument; Listthe thedocument documenttotosee see * *List whatpaths pathsexist; exist; * *what * List the document to see list/ /levels=all; levels=all; list * what paths exist; run; run; list / levels=all; run; Movethe thetable tablewewewant wanttotothe the * *Move toplevel, level,remove removetitles, titles,and and * *top * Move the table we want to the seta anew newlabel; label; * *set * top level, remove titles, and move\Contents\DataSet\Variables \Contents\DataSet\Variablestoto^;^; move * set a new label; setlabelVariables Variables"Variable "VariableInfo"; Info"; setlabel move \Contents\DataSet\Variables to ^; obtitleVariables; Variables; obtitle setlabel Variables "Variable Info"; obstitleVariables; Variables; obstitle obtitle Variables; run; run; obstitle Variables; run; Removetables tablesand anddirectories directories * *Remove don'tneed; need; * *wewedon't * Remove tables and directories delete\Contents; \Contents; delete * we don't need; run; run; delete \Contents; run; Importthe thedataset datasetasasa atable tableand and * *Import seta anew newlabel; label; * *set * Import the dataset as a table and importdata=sashelp.class data=sashelp.classtotoClass; Class; import * set a new label; setlabelClass Class"Student "StudentStatistics"; Statistics"; setlabel import data=sashelp.class to Class; run; run; setlabel Class "Student Statistics"; run; Listthe thedocument documenttotoverify verifychanges; changes; * *List list/ /levels=all; levels=all; list * List the document to verify changes; run; run; list / levels=all; run; Openthe thePDF PDFdestination; destination; * *Open odspdf; pdf; ods * Open the PDF destination; ods pdf; Replaytable tablelabeled labeled"%"%Statistics"; Statistics"; * *Replay replay^ ^ replay * Replay table labeled "% Statistics"; (where=(_label_like like'%'%Statistics')); Statistics')); (where=(_label_ replay ^ run; run; (where=(_label_ like '% Statistics')); run; Closethe thePDF PDFdestination; destination; * *Close odspdf pdfclose; close; ods * Close the PDF destination; ods pdf close; quit; quit; quit; DOCUMENT Columnfor forlogo, logo,address, address,and andtrademark trademarkinfo info Column Column for logo, address, and trademark info ODS DOCUMENT DOCUMENT ODS ODS DOCUMENT and and and PROC DOCUMENT DOCUMENT PROC PROC DOCUMENT Tip Sheet Sheet Tip Tip Sheet Thistip tipsheet sheetplaces placesfrequently frequentlyused used This information oneplace, place, onone one sheetofof information one on sheet This tip sheetinin places frequently used paper,sosoyou you don’t haveon search through paper, don’t have totosearch through information in one place, one sheet of theonline online documentation Italso alsogives givesyou you the documentation paper, so you don’t have toItsearch through something takehome, home,type in, andtry try something tototake in, and the online documentation Ittype also gives you something to take home, type in, and try TheODS ODSDOCUMENT DOCUMENTdestination destinationallows allowsyou you The store areport’s report’scomponents components orderto to totostore inin order The ODSaDOCUMENT destination allows you modify replay themusing usingPROC modify replay them to store and aand report’s components inPROC order to DOCUMENT This combination toolsallows allows DOCUMENT This combination ofoftools modify and replay them using PROC you to customize your reports far more than you to customize your reports far more than DOCUMENT This combination of tools allows using ODS options and statements alone This using ODS options and statements alone This you to customize your reports far more than tip sheet presents the most common tip sheet presents the most common using ODS options and statements alone This statements andoptions options used creating, statements and used inincreating, tip sheet presents the most common modifying, and replaying ODS documents modifying, and replaying ODS documents statements options used in creating, modifying, and replaying ODS documents SAS Institute Inc World Headquarters For complete information, refer the For complete information, refer totothe ®® +1 919 677 8000 www.sas.com/offices BaseSAS SAS 9.2 9.2documentation documentationatat Base For complete information, refer to the http://support.sas.com/v9doc http://support.sas.com/v9doc Base SAS 9.2 documentation at http://support.sas.com/v9doc SAS and all other SAS Institute Inc product ® or service names are registered trademarks or trademarks of SAS Institute Inc in the USA and other countries ® indicates USA registration Other brand and product names are trademarks of their respective companies Copyright © 2008, SAS Institute Inc All rights reserved 479398_01.08 ODS Document Proc Document Tip Sheet ODS ODSDOCUMENT DOCUMENT DOCUMENTand and andPROC PROC PROCDOCUMENT DOCUMENT DOCUMENTTip Tip TipSheet Sheet Output Output OutputObjects Objects Objects Output Output Output Output objects objects objects objects include include include include tables, tables, tables, tables, graphs, graphs, graphs, graphs, notes, notes, notes, notes, and and and and equations equations equations equations InIn In In the the the the case case case case ofof of of tables, tables, tables, tables, the the the the output output output output object object object object consists consists consists consists ofof of of the the the the data data data data and and and and a atemplate aatemplate template template name name name name ods ods ods ods trace trace trace trace on; on; on; on; Displays Displays Displays Displays information information information information about about about about output output output output objects objects objects objects asas as as they they they they are are are are created created created created This This This This information information information information includes includes includes includes the the the the name name name name ofof of of the the the the object, object, object, object, the the the the name name name name ofof of of the the the the template, template, template, template, labels, labels, labels, labels, paths, paths, paths, paths, and and and and label label label label paths paths paths paths context context context context The The The The context context context context ofof of of anan an an output output output output object object object object isis is aisaset aaset set set ofof of of attributes attributes attributes attributes that that that that are are are are attached attached attached attached toto to to the the the the output output output output object object object object The The The The parts parts parts parts ofof of of the the the the output output output output object object object object context context context context that that that that come come come come before before before before the the the the output output output output object object object object are: are: are: are: before before before before page page page page break, break, break, break, titles, titles, titles, titles, subtitles, subtitles, subtitles, subtitles, bygroup, bygroup, bygroup, bygroup, and and and and before before before before notes notes notes notes The The The The parts parts parts parts ofof of of the the the the output output output output object object object object context context context context that that that that come come come come after after after after the the the the output output output output object object object object are: are: are: are: afternotes, afternotes, afternotes, afternotes, footnotes, footnotes, footnotes, footnotes, and and and and after after after after page page page page break break break break Content Content Contentofof ofaaaDocument Document Document The The The The content content content content ofof of of the the the the document document document document includes: includes: includes: includes: output output output output object, object, object, object, the the the the output output output output object object object object context, context, context, context, and and and and the the the the output output output output object object object object hierarchy hierarchy hierarchy hierarchy The The The The content content content content ofof of of the the the the document document document document does does does does not not not not include: include: include: include: proc proc proc proc options, options, options, options, system system system system options, options, options, options, ODS ODS ODS ODS options, options, options, options, graph graph graph graph options, options, options, options, GRSEGs, GRSEGs, GRSEGs, GRSEGs, and and and and external external external external graph graph graph graph customizations customizations customizations customizations Documents Documents DocumentsWindow Window Window odsdocuments odsdocuments odsdocuments odsdocuments Entering Entering Entering Entering odsdocuments odsdocuments odsdocuments odsdocumentsinto into into into the the the the command command command command bar bar bar bar opens opens opens opens the the the the Documents Documents Documents Documents window, window, window, window, where where where where you you you you can can can can view view view view and and and and edit edit edit edit the the the the hierarchy hierarchy hierarchy hierarchy and and and and replay replay replay replay output output output output objects objects objects objects Right-clicking Right-clicking Right-clicking Right-clicking and and and and choosing choosing choosing choosing Properties Properties Properties Properties displays displays displays displays information information information information about about about about the the the the output output output output object object object object such such such such as:as: as: as: type, type, type, type, name, name, name, name, description, description, description, description, template, template, template, template, the the the the document document document document that that that that the the the the output output output output object object object object belongs belongs belongs belongs to,to, to, to, path path path path inin in in the the the the hierarchy, hierarchy, hierarchy, hierarchy, file file file file size, size, size, size, creation creation creation creation date date date date and and and and time, time, time, time, and and and and last last last last modified modified modified modified date date date date and and and and time time time time Document Document DocumentPaths Paths Paths Each Each Each Each output output output output object object object object has has has has a apath aapath path path associated associated associated associated with with with with it itit that itthat that that includes includes includes includes the the the the directory directory directory directory hierarchy, hierarchy, hierarchy, hierarchy, much much much much like like like like inin in in a aaa computer computer computer computer file file file file system system system system For For For For example: example: example: example: \Directory-1#n\ \Directory-m#n\Object#n \Directory-1#n\ \Directory-m#n\Object#n \Directory-1#n\ \Directory-m#n\Object#n \Directory-1#n\ \Directory-m#n\Object#n Each Each Each Each segment segment segment segment inin in in the the the the path, path, path, path, separated separated separated separated byby by by backslashes backslashes backslashes backslashes (\), (\), (\), (\), consists consists consists consists ofof of of a aname aaname name name (e.g., (e.g., (e.g., (e.g., Directory-1, Directory-1, Directory-1, Directory-1, DirectoryDirectoryDirectoryDirectorym,m, m, m, Object) Object) Object) Object) asas as as well well well well asas as as a asequence aasequence sequence sequence number number number number (e.g., (e.g., (e.g., (e.g., #n) #n) #n) #n) Sequence Sequence Sequence Sequence numbers numbers numbers numbers are are are are used used used used toto to to ensure ensure ensure ensure that that that that each each each each directory directory directory directory and and and and object object object object isis is uniquely isuniquely uniquely uniquely addressable addressable addressable addressable AA A A path path path path that that that that consists consists consists consists only only only only ofof of of a abackslash aabackslash backslash backslash represents represents represents represents the the the the root root root root directory directory directory directory AA A A caret caret caret caret (^) (^) (^) (^) inin in in a apath aapath path path indicates indicates indicates indicates the the the the current current current current directory directory directory directory AA A A double double double double caret caret caret caret (^^) (^^) (^^) (^^) indicates indicates indicates indicates one one one one directory directory directory directory up up up up WHERE WHERE WHERE WHERE Clauses Clauses Clauses Clauses Document Document Document Document paths paths paths paths can can can can bebe be be followed followed followed followed byby by by a aWHERE aaWHERE WHERE WHERE clause clause clause clause toto to to further further further further subset subset subset subset the the the the objects objects objects objects matched matched matched matched byby by by a aaa path path path path The The The The general general general general form form form form ofof of of WHERE WHERE WHERE WHERE clause clause clause clause usage usage usage usage isis is is shown shown shown shown below below below below document-path(where=(where-expr)) document-path(where=(where-expr)) document-path(where=(where-expr)) document-path(where=(where-expr)) Variables Variables Variables Variables available available available available inin in in a aWHERE aaWHERE WHERE WHERE clause clause clause clause are are are are listed listed listed listed inin in in the the the the following following following following table table table table Name Name Name Name Description Description Description Description _name_ _name_ _name_ _name_ Name Name Name Name ofof of of the the the the item item item item _path_ _path_ _path_ _path_ Path Path Path Path ofof of of the the the the item item item item _label_ _label_ _label_ _label_ Label Label Label Label ofof of of the the the the item item item item _labelpath_ _labelpath_ _labelpath_ _labelpath_ Labels Labels Labels Labels ofof of of allall all all entries entries entries entries inin in in path path path path _type_ _type_ _type_ _type_ Type Type Type Type ofof of of the the the the item item item item _seqno_ _seqno_ _seqno_ _seqno_ Sequence Sequence Sequence Sequence number number number number ofof of of the the the the item item item item _cdate_ _cdate_ _cdate_ _cdate_ Creation Creation Creation Creation date date date date ofof of of the the the the item item item item _mdate_ _mdate_ _mdate_ _mdate_ Modification Modification Modification Modification date date date date ofof of of the the the the item item item item _ctime_ _ctime_ _ctime_ _ctime_ Creation Creation Creation Creation time time time time ofof of of the the the the item item item item _mtime_ _mtime_ _mtime_ _mtime_ Modification Modification Modification Modification time time time time ofof of of the the the the item item item item _cdatetime_ _cdatetime_ _cdatetime_ _cdatetime_ Creation Creation Creation Creation date-time date-time date-time date-time ofof of of the the the the item item item item _mdatetime_ _mdatetime_ _mdatetime_ _mdatetime_ Modification Modification Modification Modification date-time date-time date-time date-time ofof of of the the the the item item item item variable variable variable variable BY BY BY BY variable variable variable variable Document Document DocumentDestination Destination Destination Creating Creating Creating Creating a aaDocument aDocument Document Document ods ods ods ods document document document document name=document-name; name=document-name; name=document-name; name=document-name; …… … procedure …procedure procedure procedure code code code code …… … … ods ods ods ods document document document document close; close; close; close; PROC PROC PROCDOCUMENT DOCUMENT DOCUMENT Basic Basic Basic Basic Usage Usage Usage Usage proc proc proc proc document document document document name=document-name; name=document-name; name=document-name; name=document-name; …… … statements …statements statements statements …… … … run; run; run; run; document-name document-name document-name document-name isis is the isthe the the name name name name ofof of of a adocument aadocument document document with with with with anan an an ®® ® ® optional optional optional optional SAS SAS SAS SAS library library library library name name name name Document Document Document Document Management Management Management Management Statements Statements Statements Statements An An An An access access access access option option option option can can can can bebe be be applied applied applied applied toto to to the the the the document, document, document, document, document-name, document-name, document-name, document-name, byby by by appending appending appending appending one one one one ofof of of the the the the following, following, following, following, inin in in parentheses, parentheses, parentheses, parentheses, toto to to document-name document-name document-name document-name doc doc doc doc library=library-name; library=library-name; library=library-name; library=library-name; Lists Lists Lists Lists allall all all documents documents documents documents inin in in library-name library-name library-name library-name write write write write Creates Creates Creates Creates a anew aanew new new document document document document AA A A document document document document isis is overwritten isoverwritten overwritten overwritten if ifif itifitit already italready already already exists exists exists exists update update update update Creates Creates Creates Creates a anew aanew new new document document document document AA A A document document document document isis is appended isappended appended appended toto to to if ifif itifitit already italready already already exists exists exists exists Replaying Replaying Replaying Replaying a aaDocument aDocument Document Document proc proc proc proc document document document document name=document-name; name=document-name; name=document-name; name=document-name; replay replay replay replay ; run; run; run; run; replay; replay; replay; replay; Replays Replays Replays Replays entire entire entire entire contents contents contents contents ofof of of document, document, document, document, documentdocumentdocumentdocumentname, name, name, name, toto to to allall all all open open open open ODS ODS ODS ODS destinations destinations destinations destinations replay replay replay replay path-1, path-1, path-1, path-1, …, …, …, …, path-n; path-n; path-n; path-n; Replays Replays Replays Replays only only only only specified specified specified specified paths, paths, paths, paths, path-1, path-1, path-1, path-1, …, …, …, …, path-n, path-n, path-n, path-n, toto to to allall all all open open open open ODS ODS ODS ODS destinations destinations destinations destinations replay replay replay replay / levels=n; ///levels=n; levels=n; levels=n; Replays Replays Replays Replays allall all all output output output output objects objects objects objects inin in in document-name, document-name, document-name, document-name, within within within within n nn levels nlevels levels levels ofof of of directories, directories, directories, directories, toto to to allall all all open open open open ODS ODS ODS ODS destinations destinations destinations destinations replay replay replay replay path-1, path-1, path-1, path-1, …, …, …, …, path-n path-n path-n path-n / levels=n; ///levels=n; levels=n; levels=n; Replays Replays Replays Replays only only only only specified specified specified specified paths, paths, paths, paths, path-1, path-1, path-1, path-1, …, …, …, …, path-n, path-n, path-n, path-n, within within within within n nn levels nlevels levels levels ofof of of directories directories directories directories toto to to allall all all open open open open ODS ODS ODS ODS destinations destinations destinations destinations doc doc doc doc name=document-name; name=document-name; name=document-name; name=document-name; Opens Opens Opens Opens document-name document-name document-name document-name for for for for update update update update doc doc doc doc close; close; close; close; Closes Closes Closes Closes the the the the current current current current document document document document delete delete delete delete document-name; document-name; document-name; document-name; Deletes Deletes Deletes Deletes document-name document-name document-name document-name Navigation Navigation Navigation Navigation Statements Statements Statements Statements dir; dir; dir; dir; Displays Displays Displays Displays the the the the path path path path ofof of of the the the the current current current current directory directory directory directory dir dir dir dir path; path; path; path; Changes Changes Changes Changes the the the the current current current current directory directory directory directory toto to to path path path path list list list list ; ; ; ; list list list list path-1, path-1, path-1, path-1, …, …, …, …, path-n path-n path-n path-n ; ; ; ; Lists Lists Lists Lists the the the the content content content content ofof of of the the the the current current current current directory directory directory directory oror or or path-1, path-1, path-1, path-1, …, …, …, …, path-n, path-n, path-n, path-n, respectively respectively respectively respectively The The The The following following following following options options options options are are are are available available available available Option Option Option Option Description Description Description Description bygroups bygroups bygroups bygroups Displays Displays Displays Displays BY BY BY BY variables variables variables variables details details details details Displays Displays Displays Displays verbose verbose verbose verbose information information information information follow follow follow follow Follows Follows Follows Follows links links links links levels=n levels=n levels=n levels=n | all |||all all all List List List List n nor nnor or or allall all all directory directory directory directory levels, levels, levels, levels, respectively respectively respectively respectively order=… order=… order=… order=… Sort Sort Sort Sort output output output output byby by by alpha, alpha, alpha, alpha, date, date, date, date, oror or or insert insert insert insert ... Replaying Replaying a aaDocument aDocument Document Document proc proc proc proc document document document document name =document- name; name =document- name; name =document- name; name =document- name; replay... variable Document Document DocumentDestination Destination Destination Creating Creating Creating Creating a aaDocument aDocument Document Document ods ods ods ods document document document document... customizations Documents Documents DocumentsWindow Window Window odsdocuments odsdocuments odsdocuments odsdocuments Entering Entering Entering Entering odsdocuments odsdocuments odsdocuments odsdocumentsinto