13 January 2009

DataStage: Command Line Interface (#1: Control Jobs)

เราสามารถติดต่อ DataStage ผ่านทาง Command Line ของ UNIX หรือ Windows ได้ ผ่านชุดคำสั่งที่เรียกว่า Command Line Interface ประกอบด้วยชุดคำสั่ง 3 ประเภทใหญ่ๆ ได้แก่ การรันและควบคุม Job, การจัดการ Project และ การค้นหา Job
ก่อนรัน Command Line เหล่านี้จะต้องทำการรัน Environment ของ Datastage ก่อน โดยจะต้องอ้างอิง Home Directory ของ Datastage ดังนี้

1.    หา Home Directory ของ Datatstage โดยคำสั่ง cat /.dshome
2.    รัน Environment ของ Datastage .{DSHOME}/dsenv

ชุดที่1 - การรันและควบคุม Job
ใช้คำสั่ง dsjob ตามด้วย option ต่างๆ ชุดคำสั่งนี้สามารถสั่ง
  • Starting a job
  • Stopping a job
  • Listing projects, jobs, stages, links, and parameters
  • Retrieving information
  • Accessing log files
  • Importing job executables
  • Generating a report
Run Job
dsjob -run -warn {number of warning} -wait -jobstatus -param {parameter name}={value} -param {parameter name}={value} {project name} {job name}
ตัวอย่างคำสั่งและผลลัพธ์
/Dstage/IBM/InformationServer/Server/DSEngine/bin $ dsjob -run -warn 50 -wait -jobstatus -param TSPS=ABC -param DataDate=20081112 PROJ1 test
Waiting for job...
Finished waiting for job
Job Status : (1)

Reset Job
dsjob -run -wait -mode RESET {project name} {job name}
ตัวอย่างคำสั่งและผลลัพธ์
/Dstage/IBM/InformationServer/Server/DSEngine/bin $ dsjob -run -wait -mode RESET PROJ1 test
Waiting for job...
Finished waiting for job

Stop Job
dsjob -stop {project name} {job name}
รายละเอียดเพิ่มเติมที่ IBM Information Server Documentation - Parallel Job Advanced Developer Guide, Chapter 25. WebSphere DataStage development kit (job control interfaces), Section Command line interface (C:\IBM\InformationServer1\Documentation\i46depja.pdf)

No comments: