Download presentation
Presentation is loading. Please wait.
Published byLoreen Bertha Robertson Modified over 8 years ago
1
SAUSAG 71 – 21 Aug 2014 Tech Tips Jerry Le Breton On behalf of the SAUSAG Committee
2
Did you know… ? PERL regular expressions can be used by informats created with PROC FORMAT ? SAUSAG 71 – 21 Aug 2014 What’s a PERL regular expression? It’s a pattern matching (and substitution) “language”. Whole set of prx… functions available. This is validating the format of a time variable.
3
PERLy FORMATS SAUSAG 71 – 21 Aug 2014 Use the pattern to define an INFORMAT. The REGEXP option identifies the string as a regular expression. If matched, the time8. informat is used to return a SAS time value.
4
Curly PERLy FORMATS SAUSAG 71 – 21 Aug 2014 Pattern substitutions also possible
5
PERLy FORMATS Why bother – can use PRX functions? Simpler programs Formats independent of programs - patterns can be changed without touching the programs that use the informats See: Using the New Features in PROC FORMAT Rick Langston, SAS Institute Inc., Cary, NC Many other papers SAUSAG 71 – 21 Aug 2014
6
Metadata “Data about data” SAS Metadata Server underpinning SAS products since version 9 Metadata also buried in Base SAS data sets – for decades. e.g. column labels, column formats, total observations, sorted status, …. SAUSAG 71 – 21 Aug 2014
7
Metadata – SAS Data Set SAUSAG 71 – 21 Aug 2014 Logical Components of a SAS Data Set SAS(R) 9.3 Language Reference: Concepts, Second Edition Metadata includes data set attributes, and column attributes e.g. column labels and formats
8
Data Set Descriptor Info SAUSAG 71 – 21 Aug 2014 Data Set label can be customised with useful stuff. Proc DATASETS controls most descriptor info.
9
Metadata – SAS Data Set SAUSAG 71 – 21 Aug 2014 Logical Components of a SAS Data Set SAS(R) 9.4 Language Reference: Concepts, Third Edition SAS 9.4 provides for any amount of custom metadata with Extended Attributes.
10
Data Set – Extended Attributes Attributes for the data set e.g. the “as at” date of the data set Attributes for the columns e.g. an explanation of a column’s derivation Attributes are simply Name/Value pairs You use Proc DATASETS to manage a data set’s extended attributes SAUSAG 71 – 21 Aug 2014
11
Data Set – Extended Attributes SAUSAG 71 – 21 Aug 2014 xattr statement for controlling extended attributes add a new attribute. ds indicates a data set extended attributes (rather than one for a variable) Name of extended attributes Value of extended attributes
12
Data Set – Extended Attributes SAUSAG 71 – 21 Aug 2014 New table in output of contents statement for data set extended attributes.
13
Variable – Extended Attributes SAUSAG 71 – 21 Aug 2014 Set the value of an extended attribute, ‘Privacy’, for the variable, Name.
14
Variable – Extended Attributes SAUSAG 71 – 21 Aug 2014 Multiple extended attributes can be set.
15
Variable – Extended Attributes SAUSAG 71 – 21 Aug 2014 Can store pre-calculated stats in extended attributes. Store anything in extended attributes – even the source program.
16
Accessing Extended Attributes SAUSAG 71 – 21 Aug 2014
17
Stored Extended Attributes SAUSAG 71 – 21 Aug 2014 Extended attributes in separate file: sas7bxat extension (indexes stored in files with sas7bndx extension) Use SAS to copy/move the data set Extended attributes propagate in simple processing But check doco for anything more complicated.
18
Extended Attributions Base SAS (R) 9.4 Procedures Guide, Third Edition Proc DATASETS How to store data about your data in your data Chris Hemedinger, SAS Institute Inc http://blogs.sas.com/content/sasdummy/2013/10/17/extended-attributes-sas-94/ Developer Reveals: Extended Data Set Attributes Diane Olson, SAS Institute Inc., Cary NC SGF Paper 135-2013 SAUSAG 71 – 21 Aug 2014
19
Questions? SAUSAG 71 – 21 Aug 2014 I could use an extended attribute… Jerry Le Breton Jerry.LeBreton@SoftscapeSolutions.com.au www.SoftscapeSolutions.com.au
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.