77
ODS Packages: Putting Some Zip In Your ODS Output. Eric Gebhart Principle Systems Developer 1

ODS Packages

Embed Size (px)

DESCRIPTION

ODS Packages

Citation preview

Page 1: ODS Packages

ODS Packages: Putting Some Zip In Your ODS Output.

Eric GebhartPrinciple Systems Developer

1

Page 2: ODS Packages

Packages

Page 3: ODS Packages

✓HTML

✓RTF

✓PDF

✓ Images

✓Data Sets

✓Text files

Packages

Page 4: ODS Packages

Packages .SPK.ZIP

Page 5: ODS Packages

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

Page 6: ODS Packages

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

ods html close;

ods html;

Page 7: ODS Packages

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

ods html close;

ods html;

Page 8: ODS Packages

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

ods html close;

ods html ;ods html ;

Page 9: ODS Packages

PackingSlip

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

ods html close;

ods html ;

ods Package Open;

ods html ;

Page 10: ODS Packages

PackingSlip

gplot7.gifgplot8.gifgplot9.gifgplot10.gifgplot11.gif

gplot14.gifgplot13.gifgplot12.gif

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

ods html close;

ods html ;

ods Package Open;

Package

sashtml.htmgplot.gifgplot1.gifgplot2.gifgplot3.gifgplot4.gifgplot5.gifgplot6.gif

gplot15.gifgplot16.gifgplot17.gifgplot18.gif

Page 11: ODS Packages

PackingSlip

sashtml.htmgplot.gifgplot1.gifgplot2.gifgplot3.gifgplot4.gifgplot5.gifgplot6.gifgplot7.gifgplot8.gifgplot9.gifgplot10.gifgplot11.gifgplot12.gifgplot13.gifgplot14.gifgplot15.gifgplot16.gifgplot17.gifgplot18.gif

ods Package Publish

Page 12: ODS Packages

PackingSlip

sashtml.htmgplot.gifgplot1.gifgplot2.gifgplot3.gifgplot4.gifgplot5.gifgplot6.gifgplot7.gifgplot8.gifgplot9.gifgplot10.gifgplot11.gifgplot12.gifgplot13.gifgplot14.gifgplot15.gifgplot16.gifgplot17.gifgplot18.gif

ods Package PublishArchive

archive_path = ”./”

Properties(

);

archive_name = ‘test.zip’

Page 13: ODS Packages

PackingSlip

sashtml.htmgplot.gifgplot1.gifgplot2.gifgplot3.gifgplot4.gifgplot5.gifgplot6.gifgplot7.gifgplot8.gifgplot9.gifgplot10.gifgplot11.gifgplot12.gifgplot13.gifgplot14.gifgplot15.gifgplot16.gifgplot17.gifgplot18.gif

ods Package PublishArchive

archive_path = ”./”

Properties(

);

archive_name = ‘test.zip’

Page 14: ODS Packages

PackingSlip

sashtml.htmgplot.gifgplot1.gifgplot2.gifgplot3.gifgplot4.gifgplot5.gifgplot6.gifgplot7.gifgplot8.gifgplot9.gifgplot10.gifgplot11.gifgplot12.gifgplot13.gifgplot14.gifgplot15.gifgplot16.gifgplot17.gifgplot18.gif

ods Package

Page 15: ODS Packages

ods Package

Close

Page 16: ODS Packages

ods Package

Close

Clear;

Page 17: ODS Packages

PackagePublish

Transports

Page 18: ODS Packages

✓Archive

✓Email

✓Subscribers

✓WebDav

✓Queue

PackagePublish

Transports

Page 19: ODS Packages

PackagePublish

Properties

Page 20: ODS Packages

PackagePublish

Properties

Page 21: ODS Packages

Archive

Page 22: ODS Packages

ArchiveProperties ( Archive_name = ”test.spk” Archive_path = “./”);

ods Package Publish

Archive

Page 23: ODS Packages

Email

Page 24: ODS Packages

EmailProperties ( Archive_name = ”test.spk” Archive_path = “./”)Addresses ( “[email protected]” “[email protected]”);

ods Package Publish

Email

Page 25: ODS Packages

Subscribers

Page 26: ODS Packages

Subscribers Properties ( Channel_store = ‘LDAP: ...’)

ods Package Publish

Subscribers

Page 27: ODS Packages

WebDav

Page 28: ODS Packages

WebDavProperties ( Collection_URL = ‘http://...’);

ods Package Publish

WebDav

Page 29: ODS Packages

Queue

Page 30: ODS Packages

QueueQueues ( "MQSERIES://PCONE:LOCAL" "MSMQ://JSMITH:TRANSQ"

);

ods Package Publish

Queue

Page 34: ODS Packages

SAS Integration Technologies

Page 35: ODS Packages

SAS Integration Technologies

✓Archive

✓Email

✓Subscribers

✓WebDav

✓Queue

Page 36: ODS Packages

SAS Integration Technologies

✓Archive

✓Email

✓Subscribers

✓WebDav

✓Queue

Page 37: ODS Packages

SAS Integration Technologies

Ods Package Open;

✓Archive

✓Email

✓Subscribers

✓WebDav

✓Queue

Page 38: ODS Packages

SAS Integration Technologies

Ods Package Open ;nopf

✓Archive

✓Email

✓Subscribers

✓WebDav

✓Queue

Page 39: ODS Packages

Looking Inside✓Unzip✓Proc Document✓SAS Package

Manager

Page 40: ODS Packages
Page 41: ODS Packages

unzip -t example1.zip

Archive: example1.zip testing: PackageMetaData OK testing: gplot18.gif OK testing: gplot17.gif OK testing: gplot16.gif OK testing: gplot15.gif OK testing: gplot14.gif OK testing: gplot13.gif OK testing: gplot12.gif OK testing: gplot11.gif OK testing: gplot10.gif OK testing: gplot9.gif OK testing: gplot8.gif OK testing: gplot7.gif OK testing: gplot6.gif OK testing: gplot5.gif OK testing: gplot4.gif OK testing: gplot3.gif OK testing: gplot2.gif OK testing: gplot1.gif OK testing: gplot.gif OK testing: sashtml.htm OKNo errors detected in compressed data of example1.zip.

Page 42: ODS Packages
Page 43: ODS Packages

proc document name=archive;

import archive="example1.zip" to myPackage;

list/levels=all;

run;

Listing of: \Work.Archive\Order by: InsertionNumber of levels: All Obs Path Type--------------------------------------------------------------------------------------------------- 1 \myPackage#1 Dir 2 \myPackage#1\'sashtml.htm'n#1 File 3 \myPackage#1\'gplot.gif'n#1 File 4 \myPackage#1\'gplot1.gif'n#1 File 5 \myPackage#1\'gplot2.gif'n#1 File 6 \myPackage#1\'gplot3.gif'n#1 File 7 \myPackage#1\'gplot4.gif'n#1 File 8 \myPackage#1\'gplot5.gif'n#1 File 9 \myPackage#1\'gplot6.gif'n#1 File 10 \myPackage#1\'gplot7.gif'n#1 File 11 \myPackage#1\'gplot8.gif'n#1 File 12 \myPackage#1\'gplot9.gif'n#1 File 13 \myPackage#1\'gplot10.gif'n#1 File 14 \myPackage#1\'gplot11.gif'n#1 File 15 \myPackage#1\'gplot12.gif'n#1 File 16 \myPackage#1\'gplot13.gif'n#1 File 17 \myPackage#1\'gplot14.gif'n#1 File 18 \myPackage#1\'gplot15.gif'n#1 File 19 \myPackage#1\'gplot16.gif'n#1 File 20 \myPackage#1\'gplot17.gif'n#1 File 21 \myPackage#1\'gplot18.gif'n#1 File

Page 44: ODS Packages

Copyright © 2007, SAS Institute Inc. All rights reserved.

Meta Data

Page 45: ODS Packages

Copyright © 2007, SAS Institute Inc. All rights reserved.

list 'sashtml.htm'n/details;

Listing of: \Work.Archive\myPackage#1\'sashtml.htm'n#1Order by: InsertionNumber of levels: 1 SizeType in Bytes Created Modified Symbolic Link Template---------------------------------------------------------------------------------------------------File 4536 28FEB2007:19:15:38 28FEB2007:19:15:38

Label---------------------------------------------------------------------------------------------------MARKUP, Proc, Gplot, Gplot, Plot of Height by Weight, Gplot1, Plot of Height by Weight, Gplot2, Plot of Height by Weight, Gplot3, Plot of Height by Weight, Gplot4, Plot of Height by Weight, Gplot5, Plot of Height by Weight, Gplot6, Plot of Height by Weight

Meta Data

Page 46: ODS Packages

Package Meta Data✓Description✓Abstract✓Name / Value

Page 47: ODS Packages

Package Meta Dataods Package Open Description=’My Description’ Abstract=’My abstract’ NameValue=’Author=”Me”’ ;

Page 48: ODS Packages

File Meta Data✓Description✓MimeType✓Name / Value

Page 49: ODS Packages

File Meta Data

ods Package Add File=’example1.sas’ Description=’My 1st example’ MimeType=’Text/Plain’ NameValue = ’Data=”class” ’ ;

Page 50: ODS Packages

Multiple Simultaneous packages

Page 51: ODS Packages

Multiple Simultaneous packages

ods html Package;

ods Package(two) Open;

ods pdf Package(two);ods rtf Package(two);

ods Package Open;

Page 52: ODS Packages

Package Templates

Page 53: ODS Packages

What is it???

Page 54: ODS Packages

What is it???✓Creates Package directories✓Default package attributes✓Default publish options✓Default close options

Page 55: ODS Packages

Organizing Files

By file definiton

By Mime Type

Page 56: ODS Packages

Organizing Files

path './' files = body contents frame pages code data stylesheet ;

By Mime Type

Page 57: ODS Packages

Organizing Files

path './' files = body contents frame pages code data stylesheet ;

path 'images/' mimetypes = "image/bmp image/gif image/jpg image/png" ;

Page 58: ODS Packages

A list of Paths

Proc Template; Define Package packages.example3;

Run;

Page 59: ODS Packages

A list of Paths

default_path = "./";

path './' files = body contents frame code data ;

path 'style/' files = stylesheet ;

path 'images/' mimetypes = "image/bmp image/gif image/jpg image/png" ;

Proc Template; Define Package packages.example3;

Run;

Page 60: ODS Packages

A set of Defaults

publish = Archive properties( archive_path="./" archive_name="example3.zip" );

Description = "This is my description";

Abstract = "This is my abstract";

clear = yes; NameValue = 'data="sashelp.class";

publishing_framework = no;

Proc Template; Define Package packages.example3;

Page 61: ODS Packages

Using the Template

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

Page 62: ODS Packages

Using the Template

ods package template= example3; ods html package;

ods package publish archive;ods package close;

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

Page 63: ODS Packages
Page 64: ODS Packages

unzip -t example3.zip

Archive: example3.zip testing: PackageMetaData OK testing: images/gplot18.gif OK testing: images/gplot17.gif OK testing: images/gplot16.gif OK testing: images/gplot15.gif OK testing: images/gplot14.gif OK testing: images/gplot13.gif OK testing: images/gplot12.gif OK testing: images/gplot11.gif OK testing: images/gplot10.gif OK testing: images/gplot9.gif OK testing: images/gplot8.gif OK testing: images/gplot7.gif OK testing: images/gplot6.gif OK testing: images/gplot5.gif OK testing: images/gplot4.gif OK testing: images/gplot3.gif OK testing: images/gplot2.gif OK testing: images/gplot1.gif OK testing: images/gplot.gif OK testing: ./sashtml.htm OKNo errors detected in compressed data of example3.zip.

Page 65: ODS Packages

Package Templates And

Tagsets

Page 66: ODS Packages

What does it do?✓ create a package✓ create multiple files✓ organize files ✓ set file urls✓ set file mimetypes

Automatically

Page 67: ODS Packages

Setting it up

Set File names

Set Mime Types

Set the package template

proc template; define tagset tagsets.example5; parent=tagsets.html4;

End;Run;

proc template; define tagset tagsets.example5; parent=tagsets.html4;

End;Run;

Page 68: ODS Packages

Setting it up

Set File names

Set Mime Types

package = example5;

proc template; define tagset tagsets.example5; parent=tagsets.html4;

End;Run;

Page 69: ODS Packages

Setting it up default_mimetype = "text/html"; stylesheet_mimetype = "text/css";

Set File names

package = example5;

proc template; define tagset tagsets.example5; parent=tagsets.html4;

End;Run;

Page 70: ODS Packages

Setting it up default_mimetype = "text/html"; stylesheet_mimetype = "text/css";

body = "test.html";stylesheet = "test.css";

package = example5;

proc template; define tagset tagsets.example5; parent=tagsets.html4;

End;Run;

Page 71: ODS Packages

Using It

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

Page 72: ODS Packages

Using It

proc gplot data=sashelp.class; plot height*weight; by name; run; quit;

ods tagsets.test file="example5.spk";

ods tagsets.test close;

Page 73: ODS Packages
Page 74: ODS Packages

unzip -t example5.spk

Archive: example5.spk testing: PackageMetaData OK testing: images/gplot18.gif OK testing: images/gplot17.gif OK testing: images/gplot16.gif OK testing: images/gplot15.gif OK testing: images/gplot14.gif OK testing: images/gplot13.gif OK testing: images/gplot12.gif OK testing: images/gplot11.gif OK testing: images/gplot10.gif OK testing: images/gplot9.gif OK testing: images/gplot8.gif OK testing: images/gplot7.gif OK testing: images/gplot6.gif OK testing: images/gplot5.gif OK testing: images/gplot4.gif OK testing: images/gplot3.gif OK testing: images/gplot2.gif OK testing: images/gplot1.gif OK testing: images/gplot.gif OK testing: ./test.html OK testing: style/test.css OKNo errors detected in compressed data of example5.spk.

Page 75: ODS Packages

The Future ✓Open Document Format✓MicroSoft Office Open

Page 77: ODS Packages

Copyright © 2008, SAS Institute Inc. All rights reserved. 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.