Registering Data Sources 4 Save the Metadata for the Tables 125Save the Metadata for the Tables After you specify a group for storing the source tables, use the Wizard Finish window to r
Trang 1Registering Data Sources 4 Save the Metadata for the Tables 125
Save the Metadata for the Tables
After you specify a group for storing the source tables, use the Wizard Finish window
to review the metadata that you entered
Display 8.5 Wizard Finish Window
Review the text in the metadata pane on the Wizard Finish window Shown
previously is the metadata for the CUSTOMER, ORDERS, and ORDER_ITEM source
tables If the metadata is correct, click Finish The metadata for the tables is written
to the current metadata repository
At this point, you could add the metadata that you just created to a job, or you could check in the metadata
Trang 2126 Check In the Metadata 4 Chapter 8
Check In the Metadata Under change management, new metadata objects are added to the Project tree on the SAS Data Integration Studio desktop, as shown in the following display
Display 8.6 Project Tree with Metadata Objects for Three Tables
You must check in the new table metadata in order to save it to the change-managed repository
1 In the Project tree, select the repository icon (Project: etlDev4).
2 From the SAS Data Integration Studio menu bar, select Project I Check In
Repository.
All metadata objects in the project repository will be checked into the change-managed repository The new objects will be visible in the Inventory tree
Example: Using a Source Designer to Register an External File
Preparation
An external file is a file that is created and maintained by a host operating system or
by another vendor’s software application SAS can read data from and route output to external files
Suppose that you wanted to create a report that requires information from a comma-delimited external file Your first task would be to register this file so that it an
be included in a job that creates the report Because the file is in comma-delimited format, you would use the Delimited External File source designer wizard to register the file
Assume that the following preparations have been made:
3 The comma-delimited external file is called employeeFlatFile.csv It contains information about dependents of Orion Star Sports employees
3 You have selected a default SAS application server for SAS Data Integration Studio, as described in “Selecting a Default SAS Application Server” on page 96 This server can access the employeeFlatFile.csv file
Trang 3Registering Data Sources 4 Start SAS Data Integration Studio and Open the Appropriate Metadata Profile 127
3 The main metadata repository is under change-management control In the
current example, after you register the file, you must check in its metadata For details about change management, see “Working with Change Management” on page 113
About External File Source Designers
External file source designers enable you to do the following tasks:
3 Register delimited, fixed-width, and user-defined external files The supported file types are TXT, DAT, and CSV
3 Process variable-length records and fixed-length records
3 Process character, numeric and nonstandard numeric data (such as currency data
or signed numbers)
3 Specify how missing values should be treated
3 Process data in which one record is spanned over multiple lines, as well as data in which multiple records are included in a single data line
3 Remove columns, arrange the order of the columns, change attributes of any column, and add new columns in the metadata
The external file source designers use a sample of data from the external file,
together with metadata that you enter, to estimate the length and data type of the columns You can specify the rows used in sampling of data by specifying the start record and how many records should be included in the sample To find additional information about all of the external file source designers, see the relevant topics in the SAS Data Integration Studio Help From the SAS Data Integration Studio desktop, follow these steps to display the relevant topics:
1 From the menu bar, select Help I Contents to open the "Introduction to SAS
Data Integration Studio” topic
2 Select Examples I Source Designer Examples to open the “Source Designer
Examples” topic
3 Select the topic for the type of external file that you need to process
Note: For information about using external files in SAS Data Integration Studio, follow the reference to the “Managing External Files in SAS Data
Integration Studio” topic found at the end of the “Overview” section in each of the external file examples.4
Start SAS Data Integration Studio and Open the Appropriate Metadata Profile
Follow these steps to begin work in SAS Data Integration Studio:
1 Start SAS Data Integration Studio as described in “Starting SAS Data Integration Studio” on page 93
2 Open the appropriate metadata profile as described in “Opening a Metadata Profile” on page 95
The next task is to select an external file source designer
Trang 4128 Select an External File Source Designer 4 Chapter 8
Select an External File Source Designer
To select an external file source designer, from the SAS Data Integration Studio
menu bar, select Tools I Source Designer.
The Source Designer selection window displays, as shown in the following display
Display 8.7 Source Designer Selection Window
From this window, take the following actions:
1 Open External Files.
2 Click Delimited External File.
3 Click Next.
The wizard attempts to open a connection to the default SAS application server If there is a valid connection to this server, you might be prompted for a user name and a password After you provide that information, the External File Location window displays
Trang 5Registering Data Sources 4 Specify Location of the External File 129
Specify Location of the External File
Follow these steps to specify the location of the external file:
1 Specify a physical path to the external file in the File name field, as follows:
\\d1234\sources_external\employeeFlatFile.csv The following display shows the
completed External File Location window with the path specified to the external file
Display 8.8 External File Location Window
2 When you have set the correct path to the physical file, click Next The Delimiters
and Parameters window displays