Below are a collection of dictionary table SAS® papers. Along with the DEFINE.XML file to view variable attributes, it may also be useful to create a multi-sheet excel of all datasets and CODEBOOK to characterize data.
See Pharmaceutical programming section for example of applying variable attributes from an excel file. See SAS Dictionary Tables Gallery. See also Proc Contents, Proc FREQ, Excel files, Proc SQL and SAS Macro Programming. SAS® Savvy Class: Automating Tasks using SAS Macro and Metadata Programming
Dictionary/Array Reference Functions | Result See SAS Paper, SAS Paper 2 |
---|---|
CALL LABEL ROUTINE |
Assign label to variable |
|
Returns the variable's label Example, Y=VLABEL(X); or Y=VARLABEL(X); |
|
Returns the length of the string or numeric value from a character or numeric variable |
VNAME() | Returns the variable's name, argument is often arrary index reference See also INDEX("&VAR", 'END') > 0 to compare variable names |
VTYPE() |
Returns the variable's type (N, C) |
VVALUE() | Returns the formatted value |
Download var_def macro [See also ODS and DEFINE.PDF]
* Most common to view list of variables and attributes in selected datasets;
PROC SQL;
CREATE TABLE SKELETON_VARS AS
SELECT UNIQUE libname, memname, name, type, length, label, format
FROM SASHELP.VCOLUMN
WHERE upcase(libname) = 'LEXLIB' and upcase(memname) = '_SKELETON_';
QUIT;
Beginner SAS Programmer |
Beginner Paper SAS DICTIONARY: Step by Step, Patrick Thornton
SAS® Webinar Dictionary Tables, Kirk Lafler
SAS® Webinar Dictionary Tables, Amadeus Software
SAS® Reference Accessing Information by using dictionary tables
Advanced SAS Programmer |
Advanced Paper The Design and Use of Metadata: Part Fine Art, Part Black Art, Frank DiIorio
Macro SAS Programmer |
Application Paper Considerations for Building an Integrated Safety Database Using SAS, Denise J. Smith, Daniel Schulz, Gayle Kloss, Wei Cheng
CODEBOOK: Taking Another Look At Your Data, Greg Silva Download SAS macro [Macro]
UNC CODEBOOK [Macro]
1. A Quick and Easy Data Dictionary Macro, Pete Lund
2. Data About Data: An Introduction to Dictionary Tables, Frank C. Dilorio
3. Using Metadata for Data Driven Programming, Brian Varney
5. Dictionary Tables and Views: Essential Tools for Serious Applications, Frank DiIorio, Jeff Abolafia
6. How Are All of these Tables Related? - Relational Database Map RDB_MAP.SAS, Eric Losby
7. Using Dictionary Tables to Explore SAS® Datasets, Phillip Julian
8. A Metadata Driven Programming Technique using SAS®, Xiyun Cheryl Wang
9. SQL Metadata Applications: I Hate Typing, Hannah Fresques
10. Give me EVERYTHING! A macro to combine the CONTENTS procedure output
and formats, Lynn Mullins [Variable Definition Table with formats, Macro]
11. A Simple Way to Create a Clinical Trial Study Data. Dictionary, Frank Llu
12. Utilizing the VNAME SAS® function in restructuring data files, Mirjana Stojanovic, Donna Niedzwiecki
13. How to Create Data-Driven Lists, Kate Burnett-Isaacs
14. Accessing SAS metadata and using it to help us develop data-driven SAS programs, Iain Humphreys
15. Metadata integrated programming, Jesper Zeth, Jan Skowronski
16. Creating ''Variable Name" Data Sets With CALL VNAME and PROC TRANSPOSE, David Swift
17. Metadata Management – Building Blocks
18. ‘V’ for … Variable Information Functions to the Rescue, Richann Watson, Karl Miller
19. astraZENeca and the ART of metadata maintenance, Paul Frost [Presentation]
21. Utilizing SAS® Functions to Access Variable Information, Joleen Borgerding, Akiko Chai
22. Techniques for Generating Dynamic Code from SAS® DICTIONARY Data, Jingxian Zhang
24. Metadata-driven Tool for Creation of a Dataset for Exploratory Analyses, Alexey Kuznetsov
25. Accessing SAS metadata and using it to help us develop data-driven SAS programs,Iain Humphreys [Macros]
26. Comparing dataset metadata, Jim Groeneveld
27. Comparing 6 Techniques To Do Data Driven Programming, Joris Derks
28. SAS Programming Techniques for Manipulating Metadata on the Database Level Chris Speck