Thursday, September 25, 2014

InfoSphere DataStage OSH : Setting Orchestrate (PXEngine) Command Shell

OSH is a powerful PX-Engine Orchestrate Shell which can be used to perform various operations including debugging DataStage jobs to see what is happening without using clients. Though with various clients available to create and execute Jobs, thought of sharing how minimal environment can be set to use this powerful shell. It is even helpful when want to run orchadmin command for DataSets.


On Windows Setup environment as follows – this assumes Information Server V11.3 installed in default path – C:\IBM\InformationServer (Change this location based on your install)

set APT_ORCHHOME=C:\IBM\InformationServer\Server\PXEngine
set PATH=C:\IBM\InformationServer\Server\PXEngine\bin;C:\IBM\InformationServer\Server\DSComponents\bin;%PATH%
set APT_CONFIG_FILE=C:\IBM\InformationServer\Server\Configurations\default.apt
(Change Config file you want to use for execution)

Check basic osh commands work after setting up the environment
1)      osh – usage
2)      simple job
osh "generator -schema record(a:int32) | peek -all" 












On redhat Linux  Setup environment as follows – this assumes Information Server V11.3 installed in default path – /opt/IBM/InformationServer and shell used is bash. (Change this location based on your install)

export APT_ORCHHOME=/opt/IBM/InformationServer/Server/PXEngine
export PATH=/opt/IBM/InformationServer/Server/PXEngine/bin:$PATH
export LD_LIBRARY_PATH=/opt/IBM/InformationServer/Server/PXEngine/lib:/opt/IBM/InformationServer/Server/DSComponents/bin:/opt/IBM/InformationServer/ASBNode/lib/cpp:$LD_LIBRARY_PATH
export APT_CONFIG_FILE=/opt/IBM/InformationServer/Server/Configurations/default.apt
(Change Config file you want to use for execution)
Check basic osh commands work after setting up the environment
1)      osh – usage
2)      simple job
osh "generator -schema record(a:int32) | peek -all"
 














On other UNIX environments
1)      Solaris – use environment same as linux
2)      AIX – use LIBPATH in place of LD_LIBRARY_PATH



Executing osh script file:
Use osh –f option to execute osh script file.
Eg: write following sample script to file and execute using above option
generator -schema record(a:int32) | peek -all 



Using debug variables:
I have explained here some of the environment variables I have come across which helps to debug.  Set the environment variable value to true to enable the environment variable.
For eg: on Windows
SET APT_DUMP_SCORE=TRUE

1)APT_DUMP_SCORE - to get report showing the operators, processes and data sets of current execution
2)APT_PM_PLAYER_TIMING – to shows how much CPU time each stage uses
3)APT_PM_SHOW_PIDS – to show process ID of each stage
4)APT_RECORD_COUNTS – to shows record counts in log

APT_DUMP_SCORE
APT_PM_PLAYER_TIMING

APT_PM_SHOW_PIDS
APT_RECORD_COUNTS





 


-Dhanunjaya


 Disclaimer: “The postings on this site are my own and don’t necessarily represent IBM’s positions, strategies or opinions.”

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi Ritesh,
    When I compile my job I get the following:
    "Error Complilling Parallel Transformer sample_nz_23" When I select more I get "sh: /opt/IBM/InformationServer/Server/PXEngine/osh not found". added these environmental variables to dsenv but AIX and datastage could not run osh. I added them to .profile for dsadm and osh is running successfully. However not in datastage. Are there any settings for osh on windows or on AiX if you only have information server client install on windows? Great work on this. Thanks

    ReplyDelete
  3. Disregard, I have it working, there was an extra colon in one of the Path settings, thanks

    ReplyDelete