com +917411642061
Lab 12
Features and Techniques II
Lab at a Glance................................................................2 Objectives..............................................................2 Duration.................................................................2 Exercises..........................................................................3 Exercise 1: Shortcuts ............................................3 Exercise 2: The Find Feature ................................4 Exercise 3: View Dependencies.............................6 Exercise 4: Comparing Objects .............................7 Exercise 5: Overview Window .............................10 Exercise 6: Copying and Pasting Objects ............11 Reference.......................................................................11 Shortcuts..............................................................11 Comparing Objects..............................................12 Copying & Pasting Objects...................................13
12 - 1
Lab at a Glance
Objectives
After completing the lab, the student will be able to: Use shortcuts. Find objects (use various search options). View object dependencies. Compare objects and mappings. Use the Overview window. Copy objects across mappings.
Duration
This lab should take approximately 40 minutes.
12 - 2
Exercises
Exercise 1: Shortcuts
Step 1. Create a shortcut to source. Expand the Shared_Student folder:
Ensure the mapping from the previous lab is open in the workplace and click-and-drag the EMPLOYEE source definition into the mapping. As the cursor enters the workspace, the icon should look as follows:
If it does not, start over and make sure the object is being dragged in from the Shared_Student folder. On releasing the mouse button, the following dialog box appears:
To copy an object from a shared folder (rather than creating a shortcut), hold down the CTRL key before dropping the object.
Click on Yes to create the shortcut make sure it doesnt say Copy. The curved arrow in the upper-left corner of the source definition shows that the source is a shortcut:
12 - 3
Step 2. Do not save changes. Disconnect from the Studentxx folder and do not save the changes from the previous lesson.
Open the studentxx folder. Open the m_ODS_EMPLOYEE_xx mapping. Click the Find in Workspace
Find in Workspace.
In the Find What field, enter type_code and click on the Find Now button.
12 - 4
The choices are to search for field names or table names matching the search text. If Fields is selected, the Designer searches for column or port names matching the search text. If Tables is selected, the Designer searches for table names matching the search text. The Designer saves the last 10 search strings used, in the drop -down list from both the Find in workspace and Find Next (discussed in the next step).
Notice that the workspace is re-positioned so that exp_ODS_EMPLOYEE is in the top left corner. Click Close. Step 2. Use the Find Next feature.
The Find Next features searches for a column or port name (or any set of characters in a name) in the following objects: transformations, mapplets, and source and target definitions. Unlike Find in Workspace, the Find Next feature searches one object at a time. It cannot search multiple objects at the same time. The Find Next feature works in each Designer tool. In addition, this is the only way to do a full text search in any of the tabs in the Output
Select the Source Qualifier transformation. Enter EMPLOY in the Find box on the Standard toolbar.
(The search is not case-sensitive.) Select Edit | Find Next or click the Find Next Function key F3, to search for the string button or
window (e.g., Save, Validate, Debugger, etc.). This feature is extremely useful when debugging. Select a single transformation or click in the Output window before performing the search otherwise, the Find Box will remain grayed out.
string.
Press Enter again to search for the next occurrence of the search string.
In the Navigator window, expand the Targets node in the assigned Student_xx folder.
The folder must be open (active) in the workspace for this feature to work.
12 - 6
Accept the default settings and click OK. Note its dependencies including the m_ODS_CUSTOMER_ACTIVE mapping.
Right-click the m_ODS_CUSTOMER_ACTIVE mapping and select View Dependencies. Note its dependencies including the INVOICE source definition.
12 - 7
highlighted have identical names and are shown in the same row. Note also that the ORDER_DATE port has a different data type and precision and is further highlighted in red.
Import ODS_EMPLOYEE_ROOKIE and the DIM_REP tables from the target database. These additions should not be saved after this lesson. Expand the Targets node in the Navigator window and pull ODS_EMPLOYEE into the Warehouse Designer workspace.
There is one key difference between this use of the Compare feature, and the last. The dialog box for initiating the compare now has a Browse button that will allow searching through all open folders for objects of the same type.
Right-click on ODS_EMPLOYEE, select Compare Objects and a different dialog box will appear. Click on the Browse button to the right of the Target 2: window.
Again, all differences would appear in red. In this case, the difference is the table name.
Drill down through the assigned student folder to the Targets node to select ODS_EMPLOYEE_ROOKIE. Click OK. Click on the Compare button and view the Columns tab.
12 - 8
Close and try the same steps with the DIM_REP table. Compare ODS_EMPLOYEE to DIM_REP.
Columns that do not match by name appear on different lines. There is nothing in red to indicate any differences. Only when the column names are the same will differences appear in red.
Step 3. Compare mapping instances. Disconnect from the Studentxx folder and do not save the changes from the previous lesson. Open the Studentxx folder. Open the Shared_Student folder. In the Studentxx folder, open the m_ODS_ORDER_AMOUNT_xx mapping. Select Mappings | Compare from the main menu. Click on the Browse button for Mapping 2 and select the m_ODS_ORDER_AMOUNT_xx mapping in the Shared_Student folder.
PowerCenter 9.x Level I Developer Lab Guide 12 - 9
Click on Compare button. Again, any differences will be highlighted in red. Key differences will be listed on the Summary tab, such as in this case:
Instance srt_ODS_ORDER_AMOUNT is present only in mapping in your folder. Click on the Instances tab and in the Transformations Instances, and select the agg_ODS_ORDER_AMOUNT instance. Click on the Compare Instances button. Click through the tabs to find the differences. The only difference should be on the Properties tab the Sorted Input flag was set to True for the mapping in your folder. Close the Shared_Student folder.
12 - 10
Drag the box around to re-position the mapping in the workspace. Draw a box around a couple of transformations in the workspace. Observe that the selected objects are highlighted in red in the Overview window. The Overview window remains on top of any client application (not just the Designer) until closed.
Reference
Shortcuts One of the primary advantages of using a shortcut is maintenance savings. If a change is needed to all instances of an object, make the change to the original repository object and all shortcuts to it will automatically inherit those changes. In contrast, if there are multiple copies of an object, each will need to be updated. Note that changes can also invalidate mappings and sessions. The key is to use the dependency analysis features to determine the impact of the change and plan accordingly. If the change is needed immediately, temporarily make a copy of the object until the shortcut can be updated.
12 - 11
Shortcuts have the following advantages over copied repository objects: Allow the developer to maintain a common repository object in a single location. Objects inherit all changes. Provide developers to a set of predefined metadata by incorporating the shortcuts into their work instead of developing repository objects independently. Share complex mappings, mapplets or reusable transformations across folders and repositories (if the repository housing the shared folder is a global repository). Saves space in the repository by maintaining a single repository object and using shortcuts to that object, instead of creating copies of the object in multiple folders or multiple repositories. As with copying objects, the destination folder must be open to the appropriate tool. Shortcuts cannot be created to objects from non-shared folders. Comparing Objects The Designer allows detailed comparison of two repository objects of the same type. This includes sources, targets, transformations instances, mapplets, mappings and mapping/mapplet dependencies. The comparison can be based on two objects within the same mapping, two objects across open folders or across repositories (e.g. - Development, Test, and Production). Use the following tools to compare sources, targets, or transformations: - Compare two sources, two source shortcuts or a source with a source shortcut
Source Analyzer
- Compare two targets, two target shortcuts or a target with a target shortcut.
Warehouse Designer
- Compare two reusable transformations, two reusable transformation shortcuts, or a reusable transformation with a reusable transformation shortcut.
Transformation Developer
12 - 12
- Compare two source instances, two transformation instances, two target instances or two mapplet instances. Instances of different types cannot be compared (e.g. - source instance with a transformation instance).
Mapping / Mapplet Designer
Copying & Pasting Objects The developer can copy and paste objects from mappings and mapplets within the same folder. One of the primary advantages is the ability to select more than one object at a time and paste the objects into a mapping, mapplet or both. Keep the following concepts in mind when copying and pasting objects within a folder. Objects can be copied from any mapping or mapplet in a folder to any new or existing mapping or mapplet in the same folder. Multiple objects can be copied from the workspace. Selected objects can be viewed by choosing View | Overview. Selected objects will appear in color. Objects cannot be copied from a shortcut to a mapping or mapplet. Nor is it allowed to paste objects into a shortcut to a mapping or mapplet.
12 - 13