Generate a document containing metadata of
information use to generate DEFINE.PDF
%definepdf (data = SAS data for documentation,
keys = key fields,
fmtlib = format library,
source = source data path,
outlib = output libname,
varlst = variable list report,
output = output documentation
);
Where |
Is Type... |
And
represents... |
data |
C (40 chars) |
This is a two level dataset specification as
in: libname.dataset separated by spaces. If
only a one level libname is specified, all the datasets in
the libname will be captured.
|
- If the _DEFINE dataset is specified, it will
generate the documentation based what was
captured and stored in the _DEFINE.
- If no data set is specified and the OUTLIB
has the definition previously captured, it
will regenerate the file specified by the
OUTPUT without updating the _DEFINE
definition.
| |
keys |
C (200 chars) |
Key fields that resides in the dataset.
Fields names are separated by spaces. In addition to
these specified keys; if the dataset is sorted, the sorted
by variables are considered keys. |
fmtlib |
C (optional) |
The two level name of the format library.
By default, the value is: library.formats |
source |
C (200 chars optional) |
Source path location to the source datasets.
If this were to be left blank, the feature will not be
implemented. |
outlib |
C (200 chars optional) |
The %definepdf will create an output dataset
named _DEFINE and an audit trail dataset _DEFINEA.
This will be placed in the location of the OUTLIB library.
If this were to be left blank, it will place these
datasets at the same location as the DATA parameter. |
varlst |
C (3 chars optional) |
The variable list report is optionally
produced at the bottom of the DEFINE.PDF or DEFINE.RTF.
This report lists all the variables from the selected
datasets. It displays those variables that appear in
more than one datasets side by side for your review of the
attributes. Valid values include:
| This is not generated for
DEFINE.XML since the XML structure does not
support a variable list report. | |
output |
C (200 chars) |
The name of the output file. This can
be in PDF, XML, RTF, and XLS format. If none is
specified, the default would be DEFINE.PDF. | Details
This tool generates an excel spreadsheet or a RTF file
with two sections including data and variables.
-
Data - A listing of the dataset names with
hyperlinks to the associated variable sections. The
dataset names are accompanied by the dataset labels.
This will be listed alphabetically. -
Variables - A list of the variables in
each dataset is displayed with the key fields listed first
followed by the rest of the variables alphabetically.
Attributes listed include:
-
variable name -
variable label -
type -
decoded formats - format names are displayed.
If it is a user defined format, a decoded format code will
be displayed. -
origins - This will have the value of either
"CRF page" or "derived". An
algorithm is used to estimate if it is derived. If
the variable is within a dataset has matching attributes
with a variable in a dataset from the source path, it
will be considered "CRF page". Otherwise,
it is considered derived. -
role - this will be either key or blank. An example definepdf.xls
is shown here:
Data Path: | c:\temp\mypath | |
|
|
|
|
|
Data Name: | ae | |
|
|
|
|
|
Data Label: | Adverse Event | |
|
|
|
|
|
|
|
|
|
|
|
|
|
Variable | Label | Type | Length | Format | Format Code | Origins | Role |
AE | ADVERSE EXPERIENCE | Char | 100 | $char100 | |
|
|
AEND | ADVERSE EXPERIENCE ND | Char | 2 | |
|
|
|
AEPAGENO | ADVERSE EVENT PAGE NUMBER | Num | 8 | |
|
|
|
AESEQNO | SEQUENCE NUMBER | Num | 8 | |
|
|
|
BODYNAME | BODYNAME | Char | 35 | |
|
|
|
If the %definepdf macro is called without any
parameters, a dialog box is displayed as shown here: A dataset named _DEFINE is created or updated
capturing all the metadata. An additional dataset named
_DEFINEA is created capturing the audit trail of the edits
performed. The edit button will allow you to edit the existing
definition if it already has been previously captured. The
user name and time stamp will be captured documenting the last
edit applied.
| For SAS version 8.2, it is required that
the hotfix 82BB97
(windows
version) be applied before the DEFINE.PDF version can
be generated with proper hyperlinks. | Example libname dataware 'c:\mypath\to\data';%definepdf (data =dataware,
source=C:\path\to\source\data, fmtlib =library.formats,
output =define.xls,
keys =ptid); *** Generate the OUTPUT file from existing definition ***; %definepdf (outlib=mylib,
output = c:\mydir\define.pdf); |