Top Banner
DataStage Administrator commands to find: No Command Description Command 1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS; SELECT COUNT(*) FROM DS_JOBOBJECTS; 2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS 3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job' CLEAR.FILE RT_Logxx where xx is JOBNO. 4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME> 5 Find how many Jobs are using given Hashed file as INPUT select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOB DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECT DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group b 6 Find how many Jobs are using given Hashed file as OUTPU select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOB DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJEC DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group b 7 Find how many Jobs are using given Hashed file as INPUT and OUTPUT select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOB DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Ha 8 View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME 9List metadata of hashfile SELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV" "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", 10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VAL 11 Find which user modified the job last SELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLAS NAME';
131

DS Admin Cmds

Feb 08, 2016

Download

Documents

Mohammed Hafiz

this document provides insights to Datastage commands used by admin's
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DS Admin Cmds

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   9List metadata of hashfile SELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM

DICT hashedfile ORDER BY "FIELD.NO", "TYPE";   

10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');   

11Find which user modified the job last SELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';    

12List all the projects in DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;

   13Reset surrogate key generated using

Keymgmt function in Datastage UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

Page 2: DS Admin Cmds

   14List all the surrogate key variables

used in datastage proj SELECT * FROM SDKSequences;   

15List Datastage error message decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';

   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI: Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters 1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs <projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams <projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations <projectname> <jobname>

   4Generate XML report of job , its stages and links @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

Page 3: DS Admin Cmds

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -wait -jobstatus -param

<name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop <projectname> <SeqJobname>

   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import <projectname> <DSXfilename> -

Page 4: DS Admin Cmds

overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO =

Page 5: DS Admin Cmds

DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;   

8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME   

9List metadata of hashfile SELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the job last SELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in DataStage..

With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   14List all the surrogate key variables

used in datastage proj SELECT * FROM SDKSequences;   

15List Datastage error message decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';

   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI: Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

Page 6: DS Admin Cmds

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters 1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs <projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams <projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations <projectname> <jobname>

   4Generate XML report of job , its stages and links @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -wait -jobstatus -param

<name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop <projectname> <SeqJobname>

   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenv

Page 7: DS Admin Cmds

bin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import <projectname> <DSXfilename> -

overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

Page 8: DS Admin Cmds

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

Page 9: DS Admin Cmds

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r

Page 10: DS Admin Cmds

Sequencer job -oc -oj <projectname> <SeqJobname>   

6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>

Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop <projectname> <SeqJobname>

   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data

Page 11: DS Admin Cmds

Stage Director   

9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import <projectname> <DSXfilename> -overwrite

   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

Page 12: DS Admin Cmds

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Page 13: DS Admin Cmds

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)

Page 14: DS Admin Cmds

./uv -admin -stop

./uvregen

./uv -admin -start   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist

Page 15: DS Admin Cmds

5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

Page 16: DS Admin Cmds

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

Page 17: DS Admin Cmds

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows:

Page 18: DS Admin Cmds

ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

Page 19: DS Admin Cmds

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;

Page 20: DS Admin Cmds

DataStage.. With Owner   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>

Page 21: DS Admin Cmds

List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams <projectname> <jobname>

List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations <projectname> <jobname>

   4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)

Page 22: DS Admin Cmds

unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

Page 23: DS Admin Cmds

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL

Page 24: DS Admin Cmds

DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   

Page 25: DS Admin Cmds

6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>

Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop <projectname> <SeqJobname>

   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   

Page 26: DS Admin Cmds

9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import <projectname> <DSXfilename> -overwrite

   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     6Find how many Jobs are using select DS_JOBS.NAME AS JOB_NAME FMT '35L' from

Page 27: DS Admin Cmds

given Hashed file as OUTPUDS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Page 28: DS Admin Cmds

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)

Page 29: DS Admin Cmds

./uv -admin -stop

./uvregen

./uv -admin -start   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist

Page 30: DS Admin Cmds

5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

Page 31: DS Admin Cmds

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

Page 32: DS Admin Cmds

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows:

Page 33: DS Admin Cmds

ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

Page 34: DS Admin Cmds

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;

Page 35: DS Admin Cmds

DataStage.. With Owner   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>

Page 36: DS Admin Cmds

List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams <projectname> <jobname>

List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations <projectname> <jobname>

   4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)

Page 37: DS Admin Cmds

unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

Page 38: DS Admin Cmds

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL

Page 39: DS Admin Cmds

DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   

Page 40: DS Admin Cmds

6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>

Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop <projectname> <SeqJobname>

   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   

Page 41: DS Admin Cmds

9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import <projectname> <DSXfilename> -overwrite

   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     6Find how many Jobs are using select DS_JOBS.NAME AS JOB_NAME FMT '35L' from

Page 42: DS Admin Cmds

given Hashed file as OUTPUDS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Page 43: DS Admin Cmds

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)

Page 44: DS Admin Cmds

./uv -admin -stop

./uvregen

./uv -admin -start   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist

Page 45: DS Admin Cmds

5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

Page 46: DS Admin Cmds

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

Page 47: DS Admin Cmds

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows:

Page 48: DS Admin Cmds

ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

Page 49: DS Admin Cmds

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;

Page 50: DS Admin Cmds

DataStage.. With Owner   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>

Page 51: DS Admin Cmds

List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams <projectname> <jobname>

List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations <projectname> <jobname>

   4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)

Page 52: DS Admin Cmds

unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

Page 53: DS Admin Cmds

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL

Page 54: DS Admin Cmds

DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   

Page 55: DS Admin Cmds

6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>

Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop <projectname> <SeqJobname>

   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   

Page 56: DS Admin Cmds

9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import <projectname> <DSXfilename> -overwrite

   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     6Find how many Jobs are using select DS_JOBS.NAME AS JOB_NAME FMT '35L' from

Page 57: DS Admin Cmds

given Hashed file as OUTPUDS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Page 58: DS Admin Cmds

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)

Page 59: DS Admin Cmds

./uv -admin -stop

./uvregen

./uv -admin -start   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist

Page 60: DS Admin Cmds

5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

Page 61: DS Admin Cmds

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

Page 62: DS Admin Cmds

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows:

Page 63: DS Admin Cmds

ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

Page 64: DS Admin Cmds

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;

Page 65: DS Admin Cmds

DataStage.. With Owner   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>

Page 66: DS Admin Cmds

List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams <projectname> <jobname>

List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations <projectname> <jobname>

   4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)

Page 67: DS Admin Cmds

unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

Page 68: DS Admin Cmds

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL

Page 69: DS Admin Cmds

DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   

Page 70: DS Admin Cmds

6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>

Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop <projectname> <SeqJobname>

   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   

Page 71: DS Admin Cmds

9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import <projectname> <DSXfilename> -overwrite

   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     6Find how many Jobs are using select DS_JOBS.NAME AS JOB_NAME FMT '35L' from

Page 72: DS Admin Cmds

given Hashed file as OUTPUDS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Page 73: DS Admin Cmds

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)

Page 74: DS Admin Cmds

./uv -admin -stop

./uvregen

./uv -admin -start   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist

Page 75: DS Admin Cmds

5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

Page 76: DS Admin Cmds

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

Page 77: DS Admin Cmds

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows:

Page 78: DS Admin Cmds

ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

Page 79: DS Admin Cmds

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;

Page 80: DS Admin Cmds

DataStage.. With Owner   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>

Page 81: DS Admin Cmds

List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams <projectname> <jobname>

List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations <projectname> <jobname>

   4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)

Page 82: DS Admin Cmds

unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

Page 83: DS Admin Cmds

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL

Page 84: DS Admin Cmds

DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   

Page 85: DS Admin Cmds

6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>

Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop <projectname> <SeqJobname>

   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   

Page 86: DS Admin Cmds

9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import <projectname> <DSXfilename> -overwrite

   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     6Find how many Jobs are using select DS_JOBS.NAME AS JOB_NAME FMT '35L' from

Page 87: DS Admin Cmds

given Hashed file as OUTPUDS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Page 88: DS Admin Cmds

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)

Page 89: DS Admin Cmds

./uv -admin -stop

./uvregen

./uv -admin -start   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist

Page 90: DS Admin Cmds

5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

Page 91: DS Admin Cmds

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

Page 92: DS Admin Cmds

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows:

Page 93: DS Admin Cmds

ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

Page 94: DS Admin Cmds

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;

Page 95: DS Admin Cmds

DataStage.. With Owner   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>

Page 96: DS Admin Cmds

List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams <projectname> <jobname>

List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations <projectname> <jobname>

   4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)

Page 97: DS Admin Cmds

unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

Page 98: DS Admin Cmds

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL

Page 99: DS Admin Cmds

DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   

Page 100: DS Admin Cmds

6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>

Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop <projectname> <SeqJobname>

   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   

Page 101: DS Admin Cmds

9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import <projectname> <DSXfilename> -overwrite

   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     6Find how many Jobs are using select DS_JOBS.NAME AS JOB_NAME FMT '35L' from

Page 102: DS Admin Cmds

given Hashed file as OUTPUDS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Page 103: DS Admin Cmds

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)

Page 104: DS Admin Cmds

./uv -admin -stop

./uvregen

./uv -admin -start   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist

Page 105: DS Admin Cmds

5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

Page 106: DS Admin Cmds

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in

DataStage.. With Owner SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

Page 107: DS Admin Cmds

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams

<projectname> <jobname>List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations

<projectname> <jobname>   

4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows:

Page 108: DS Admin Cmds

ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q

DataStage Administrator commands to find:

Page 109: DS Admin Cmds

No Command Description Command          

1DS Project Object counts SELECT COUNT(*) FROM DS_JOBS;

SELECT COUNT(*) FROM DS_JOBOBJECTS;     

2List all jobs in a DS project SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS

     3Clear Log From Administrator select JOBNO from DS_JOBS where NAME='Name of the job'

CLEAR.FILE RT_Logxx where xx is JOBNO.

     4CLEAR HASH FILE. CLEAR.FILE <HASHED FILE NAME>

     

5Find how many Jobs are using given Hashed file as INPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedInput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

     

6Find how many Jobs are using given Hashed file as OUTPU

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CHashedOutput' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'hashed file name' group by JOB_NAME;

   

7Find how many Jobs are using given Hashed file as INPUT and OUTPUT

select DS_JOBS.NAME AS JOB_NAME FMT '35L' from DS_JOBOBJECTS, DS_JOBS where DS_JOBOBJECTS.OLETYPE in ('CHashedOutput','CHashedInput') and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO and EVAL DS_JOBOBJECTS."@RECORD<6>" = 'Hashed file name' group by JOB_NAME;

   8View column data in a hashed file SELECT COLUMN_NAME FROM HASHED_FILE_NAME

   

9List metadata of hashfileSELECT "FIELD", "FIELD.TYPE", "FIELD.DEF", "FIELD.CONV", "FIELD.HEAD", "FIELD.FMT", "FIELD.ASSOC" FROM DICT hashedfile ORDER BY "FIELD.NO", "TYPE";

   10Insert data into the hashfile INSERT INTO HASHED_FILE_NAME (COLUMN_NAME) VALUES ('VALUE');

   11Find which user modified the

job lastSELECT INSTANCE, DTM, MODIFIER FROM DS_AUDIT WHERE CLASS = '2' AND INSTANCE LIKE 'JOB NAME';

   12List all the projects in SELECT @ID, NAME FMT '40L' FROM UV.ACCOUNT;

Page 110: DS Admin Cmds

DataStage.. With Owner   

13Reset surrogate key generated using Keymgmt function in Datastage

UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'Your_Sequence_Name';

   

14List all the surrogate key variables used in datastage proj

SELECT * FROM SDKSequences;

   15List Datastage error message

decsription, given error me SELECT * FROM SYS.MESSAGE WHERE @ID = '081002';   

16List all jobs using a TABLE

SELECT DS_JOBS.NAME AS JOB_NAME, DS_JOBS.CATEGORY, DS_JOBOBJECTS.NAME AS OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, EVAL DS_JOBOBJECTS."if index(upcase(@RECORD),'TABLE_NAME',1) > 0 then 'FOUND' else ''" AS FOUND FMT '5L' FROM DS_JOBS, DS_JOBOBJECTS WHERE DS_JOBS.JOBNO = DS_JOBOBJECTS.OBJIDNO and FOUND = 'FOUND' GROUP BY JOB_NAME, DS_JOBS.CATEGORY, OBJECT_NAME, DS_JOBOBJECTS.OLETYPE, FOUND;

         

Using DS CLI:Datastage Command line interface or CLI is a set of commands you can run on the Datastage server machine, @Unix prompt, with a username with sufficient privilaes and after setting datastage environment.

      

Steps to set Datastage Environment, to use Datastage CLI

1) Log in to Datastage Server2) set path to the directory where DSEngine exe resides3) execute command : . ./dsenv (on UNIX servers, DSJOB has a runtime dependency on the libvmdsapi.so shared library, dsenv sets required library paths for CLI commands)

   

1Find total number of connection made from client to Datastage server with the identification of IP address in it.

netstat -a | grep 'dsrpc'

   2List all datastage processes executing on the server ps -ef|grep RUN

   

3Listing projects, jobs, and parameters

1)set fully qualified path for dsjob exefor example, DsServe > /etl/Ascential/Datastage/DSEngine/bin/dsjob

List Projects @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lprojectsList Jobs in a project @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -ljobs

<projectname>

Page 111: DS Admin Cmds

List job parameters @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -lparams <projectname> <jobname>

List job invocation ids @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -linvocations <projectname> <jobname>

   4Generate XML report of job , its stages and links

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -report <projectname> <jobname>

   5Do a pattern based search for job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -matches -sub -oc -oj <projectname> <jobname>

List Sequencer jobs calling a specified job in the project

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -usedby -r -oc -oj <projectname> <jobname>

List all jobs called in specified Sequencer job

@DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dssearch -ljobs -uses -r -oc -oj <projectname> <SeqJobname>

   6Run datastage job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -run -mode <NORMAL/RESET/VALIDATE> -

wait -jobstatus -param <name1=val1> -param <name2=val2> <projectname> <SeqJobname>Stop a running job @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -stop

<projectname> <SeqJobname>   

7Start and stop Datastage Server

1)first check that no one is connected to DataStage (netstat -a | grep dsrpc) 2)User Datastage administrator userid3)./uv -admin -stop ./uvregen ./uv -admin -start

   

8Unlock locked/hung datastage processes

Data Stage throws error with "Unable to run job", it means there are hung processes are sitting for the particular Job. We need to kill those hung processes and clear the job locks in UV. Follow the steps to resolve this issue: Step 1: 1. Find the processes corresponding to the job name that fails with this error. For instance if the job is MHIS_Extract2, then the command is as follows: ps -ef | grep MHIS Then kill those processes using kill command. Step 2: Clear the job locks in UV. Login to UNIXcd /opt/etl/Ascential/DataStage/DSEngine. ./dsenvbin/uvshlogto uvlist.readu everyLocate the job that appears to be lockedWrite down the associated number from the 4th column (Userno)

Page 112: DS Admin Cmds

unlock user ##### all (where ##### is the Userno from the above step) When running the above command you should see output similar to the following: Clearing Record locks.Clearing GROUP locks.Clearing FILE locks. To exit out of UV type q . Step 3: Clear the Status file and clean up resources of the job from Data Stage Director

   9Import Datastage jobs @DsServe >> /etl/Ascential/Datastage/DSEngine/bin/dsjob -import

<projectname> <DSXfilename> -overwrite   

10Troubleshoot Client connectivity from datastage server unix prompt

1. Login to UNIX host using NIS+ account2. . ./dsenv3. cd $DSHOME4. bin/uv If error "Unable to open unohist" Then file permissions issues exist5. logto <DataStage project name> If successful Then client connectivity problems are not due to server config.6. q