Skip to main content

how to search for jobs with specific status in Datastage via command line?

Datastage deployment can be easy but such a pain when it comes to validation.
Remember the times when you deployed hundreds or thousand of jobs an you need to validate whether you left one or two jobs un-compiled? 
Developers gets lazy at times and so struggle to find ways to simplify stuff and make his life easier with a few commands. The following comes handy in this case...


Login on the datatage unix box and execute the following sequence of commands:
1. cd <DSHOME>
2. . ./<dsenvironment variable file>
3. dsjob -ljobs -status 98 <DS_PROJECT>

Supply status  = 98 (“Not Compiled”) and the DS Project.


This will show all uncompiled job list in your DS Project environment.


bash-4.2$ cd /app/ibm/InformationServer/Server/DSEngine
bash-4.2$ . ./dsenv
bash-4.2$ dsjob -ljobs -status 98 MY_DS_PROJECT_DEV
DUMMY_ACTIVITY
DUMMY_MEMBER
DUMMY_LEAD
DUMMY_OPPORTUNITY
DUMMY_HISTORY
DUMMY_PRODUCT
DUMMY_RECORD
DUMMY_USER

Status code = 0
bash-4.2$


Below are the list of available statuses from IBM Technote that can be found on the following link:


Runnable Job Status (do something) 
1 "Finished"
2 "Finished (see log)"
9 "Has been reset"
11 "Validated OK"
12 "Validated (see log)"
21 "Has been reset"
99 "Compiled"

Runnable Job Status (do something)
0 "Running"
3 "Aborted"
8 "Failed validation"
13 "Failed validation"
96 "Aborted"
97 "Stopped"
98 "Not Compiled" 

Comments

  1. Such a nice thing you had provided here. While hiring with the people for certain position, these are the things to keep in mind. Thank you very much for providing this here. And i am expecting much more information from you


    Manpower Consultancy in Chennai

    ReplyDelete
  2. Very Nice Information of datastage .... thanks for sharing Datastage_Online_Training

    ReplyDelete

Post a Comment

Popular posts from this blog

How to extract prefix or suffix on a unix string

Sometime you are processing a lot files and you have to construct a dynamic prefix and suffix based file names. So you can search for multiple files based on prefix pattern and suffix pattern. Here's how you extract the PREFIX of a string given you have some sort of delimiter in the string itself. bash-4.1$ echo "THISPREFIX_blahblah_yyymmdd.txt" THISPREFIX_blahblah_yyymmdd.txt bash-4.1$ var123="THISPREFIX_blahblah_yyymmdd.txt"; file_prefix=" ${var123%%_*} " ; echo $file_prefix THISPREFIX bash-4.1$ In the above example string what we want to extract are the charcters after the _ (underscore) thus in our variable manipulation we specified _ after the %% which denotes that we get all the characters before _. So for the SUFFIX extraction the patter is similar only we use ## instead of %%. see below : bash-4.1$ echo "THISPREFIX_blahblah_yyymmdd.txt" THISPREFIX_blahblah_yyymmdd.txt bash-4.1$ var123="THISPREFIX_bla

How to override parameter set value for a specific parameter in Datastage via unix command line ?

Sometimes you are running a data fix for production in datastage eg. back loading data and you get lazy to create a monstrous SQL just to replicate what the actual job is doing. You find yourself creating a unix script replicating the sequence call to the jobs that only populates the table you are fixing, of course you do not want other jobs in the sequence to be re-run during the fix which will mess up other tables. An then you come across a parameter set in which you only need specific values of the parameter set to be passed with different values eg. Connection details. Now that's simple if your parameter set is not importing environment variables. As per IBM it should just be : dsjob -run -wait -jobstatus -param " paramset.paramfield"="myvalues" MYDSPROJECT my_sample_ds_job see the following link : https://www-01.ibm.com/support/knowledgecenter/SSZJPZ_11.3.0/com.ibm.swg.im.iis.ds.direct.doc/topics/t_ddesref_running_job_command_line.html Its a di

How to DUMP dataset to a flat file in Datastage ?

This can actually be found on ibm website : http://www-01.ibm.com/support/docview.wss?uid=swg21625028 $ cd /app/ibm/InformationServer/Server/DSEngine/ $ . ./dsenv $ export APT_CONFIG_FILE=/app/ibm/InformationServer/Server/Configurations/default.apt $ $APT_ORCHHOME/bin/orchadmin dump -delim '|' sample_dataset.ds > sample_dataset.txt In the above example the DSEngine location my vary depending on your installation path.