| |
GeekInterview.com > Interview Questions > Data Warehousing > DataStage
| Print | |
Question: What are Routines and where/how are they written and have you written any routines before?
Answer: Routines are stored in the Routines branch of the DataStage Repository, where you can create, view or edit. The following are different types of routines: 1) Transform functions 2) Before-after job subroutines 3) Job Control routines |
| November 11, 2005 15:11:58 |
#2 |
| bvrp |
Member Since: November 2005 Total Comments: 5 |
RE: What are Routines and where/how are they written a... |
| RoutinesRoutines are stored in the Routines branch of the DataStage Repository,where you can create, view, or edit them using the Routine dialog box. Thefollowing program components are classified as routines:• Transform functions. These are functions that you can use whendefining custom transforms. DataStage has a number of built-intransform functions which are located in the Routines ➤ Examples➤ Functions branch of the Repository. You can also defineyour own transform functions in the Routine dialog box.• Before/After subroutines. When designing a job, you can specify asubroutine to run before or after the job, or before or after an activestage. DataStage has a number of built-in before/after subroutines,which are located in the Routines ➤ Built-in ➤ Before/Afterbranch in the Repository. You can also define your ownbefore/after subroutines using the Routine dialog box.• Custom UniVerse functions. These are specialized BASIC functionsthat have been defined outside DataStage. Using the Routinedialog box, you can get DataStage to create a wrapper that enablesyou to call these functions from within DataStage. These functionsare stored under the Routines branch in the Repository. Youspecify the category when you create the routine. If NLS is enabled,9-4 Ascential DataStage Designer Guideyou should be aware of any mapping requirements when usingcustom UniVerse functions. If a function uses data in a particularcharacter set, it is your responsibility to map the data to and fromUnicode.• ActiveX (OLE) functions. You can use ActiveX (OLE) functions asprogramming components within DataStage. Such functions aremade accessible to DataStage by importing them. This creates awrapper that enables you to call the functions. After import, youcan view and edit the BASIC wrapper using the Routine dialogbox. By default, such functions are located in the Routines ➤Class name branch in the Repository, but you can specify your owncategory when importing the functions.When using the Expression Editor, all of these components appear underthe DS Routines… command on the Suggest Operand menu.A special case of routine is the job control routine. Such a routine is usedto set up a DataStage job that controls other DataStage jobs. Job controlroutines are specified in the Job control page on the Job Properties dialogbox. Job control routines are not stored under the Routines branch in theRepository.TransformsTransforms are stored in the Transforms branch of the DataStage Repository,where you can create, view or edit them using the Transform dialogbox. Transforms specify the type of data transformed, the type it is transformedinto, and the expression that performs the transformation.DataStage is supplied with a number of built-in transforms (which youcannot edit). You can also define your own custom transforms, which arestored in the Repository and can be used by other DataStage jobs.When using the Expression Editor, the transforms appear under the DSTransform… command on the Suggest Operand menu.FunctionsFunctions take arguments and return a value. The word “function” isapplied to many components in DataStage:• BASIC functions. These are one of the fundamental buildingblocks of the BASIC language. When using the Expression Editor,Programming in DataStage 9-5you can access the BASIC functions via the Function… commandon the Suggest Operand menu.• DataStage BASIC functions. These are special BASIC functionsthat are specific to DataStage. These are mostly used in job controlroutines. DataStage functions begin with DS to distinguish themfrom general BASIC functions. When using the Expression Editor,you can access the DataStage BASIC functions via the DS Functions…command on the Suggest Operand menu.The following items, although called “functions,” are classified as routinesand are described under “Routines” on page 9-3. When using the ExpressionEditor, they all appear under the DS Routines… command on theSuggest Operand menu.• Transform functions• Custom UniVerse functions• ActiveX (OLE) functionsExpressionsAn expression is an element of code that defines a value. The word“expression” is used both as a specific part of BASIC syntax, and todescribe portions of code that you can enter when defining a job. Areas ofDataStage where you can use such expressions are:• Defining breakpoints in the debugger• Defining column derivations, key expressions and constraints inTransformer stages• Defining a custom transformIn each of these cases the DataStage Expression Editor guides you as towhat programming elements you can insert into the expression. |
| |
Back To Question | |