Skip to main content

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.

Comments

Popular posts from this blog

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 ...

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...

Where can you find .odbc.ini and tnsnames.ora in Datastage server ?

Open up the director log for any Datastage job, you'll notice that after the logs that says  "Starting job..." "Attached Message Handlers: " "Environment variable settings: " Open Up that Environment variable settings logs and you will find a bunch of ENV variables being set at the start for execution. Just copy and paste that in any text editor and search for the ODBCINI for the .odbc.ini and TNS_ADMIN for the tnsnames.ora. You should see the following in the env variable settings logs, it maybe different but it will look the same : ODBCINI=/app/ibm/InformationServer/Server/DSEngine/.odbc.ini /app/ibm/dba/oracle_<version>/product/<version>/client_1/network/admin eg.  TNS_ADMIN=/app/ibm/dba/oracle_11_2/product/11.2.0/client_1/network/admin