Monday, June 13, 2011

InfoSphere DataStage Command Line Interfaces - Series 1 "dsjob"

IBM InfoSphere DataStage also provides  a command line interface along with a C API, and a BASIC interface for controlling its jobs. Command Line Interface can be used to Control jobs, Administer projects, and search or list for objects in the repository. Similarly C API and BASIC interface can be used to write programs to control jobs. In simple words I can say InfoSphere DataStage CLI comprises four groups of commands, one for running jobs, one for administering projects, one for searching for objects, and another one for importing objects.

In Series 1, I intend to cover "dsjob" a command line utility extensively used to start and stop jobs, and retrieve information about job runs. dsjob provides a wide range of options. Output provided by dsjob command is in plain text without column headings on lists, or any other sort of description. This enables the command to be used in shell or batch scripts without extra processing. And so can be used by other schedulers like Tivoli or other 3rd party schedulers which can use this mechanism to manage DataStage Jobs.
On successful execution "dsjob"  returns a completion code of 0 to the operating system and on failure one of the error codes. Click here to see various DataStage API Error Codes Error Codes. The return code is also printed to the standard error stream in all cases. On UNIX servers, a code of 255 is returned if the error code is negative or greater than 254, to see the "real" return code in these cases, capture and process the standard error stream. On UNIX "dsjob" has a runtime dependency on the shared library.
Here are various "dsjob " options
  • The logon clause: Buy default, the InfoSphere DataStage CLI connects to the engine on the local system using the user name and password of the user running the command. Authenticate to DSEngine via dsjob to execute any options with dsjob, need to authenticate to Engine is must. Here is simple option to use dsjob when we are not using default port (31538) to run DSEngine from the same machine and user logged in to shell with user having access to execute commands on DSEngine.  dsjob -server :<DSEngine port_number> <command e.g. -lprojects
Other options are to provide user name, password and domain details which in many cases on production system not feasible.
  • Starting a job: -run option can be used to start, stop, validate, and reset DataStage jobs. Click for Detailed explanation dsjob -run optins
  • Stopping a job: -stop option is used to stop any DataStage Job.
    dsjob -stop [useid] project job|job_id. 
  • Listing (projects, jobs, stages, links, and parameters) Click to see dsjob <listing options>
  • Setting an alias for a job: Specifying own ID for any DataStage Job.
    dsjob -jobid [my_ID] project job 
  • Retrieving information: dsjob command can be used to retrieve and display the available information about specific projects, jobs, stages, or links.
    dsjob <Info Options> [useid] project job|job_id
  • Accessing log files: dsjob command can be used to add entries to a job's log file, or retrieve and display specific log entries.
    dsjob <Logging Options> [ -info | -warn ] [useid] project job|job_id
  • Generating a report: dsjob command can be used to generate an XML format report containing job, stage, and link information.
    dsjob -report [useid] project job|jobid [report_type]
 In Series 2 will cover dsadmin
Disclaimer: The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.

No comments:

Post a Comment