Job List with category

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
russ356
Charter Member
Charter Member
Posts: 38
Joined: Tue Jun 07, 2005 6:58 am

Job List with category

Post by russ356 »

For the last couple of days I have been doing some research on how to get a list of jobs from the DS server and what category they are in. I did much research on DSXchange but I didn't find a true solution, so I am posting my solution so maybe it can help someone else.

1. Below is the bat file I wrote to extract the information. This must be run from the client machine. First, it will get a list of projects and then it will loop through each project and populate a text file with the names of the jobs.

2. I then parsed the text file using Access to populate a table and create a report.

Code: Select all

@echo off
    SETLOCAL

    SET Host=
    SET /p Host=Type User and press Enter: 

    SET User= 
    SET /p User=Type User and press Enter: 
 
    SET PW= 
    SET /p PW=Type Password and press Enter: 

    SET DsJob=C:\Progra~1\Ascential\DataStage7.5.1\dsjob.exe
    SET DsSearch=C:\Progra~1\Ascential\DataStage7.5.1\dssearch.exe
    SET ProjectList=ProjectList.txt
    SET JobList=JobList.txt
  
:: Pull project information 

    %DsJob% -server %Host% -user %User% -password %PW% -lprojects > %ProjectList% 
    IF NOT %ERRORLEVEL%==0 GOTO END

:: Loop through all projects and populate job list

    for /F "tokens=1" %%i in (%ProjectList%) do 
    (
              ECHO PROJECT:  %%i >> %Host%.txt
              %DsSearch% -server %Host% -user %User% -password %PW% -ljobs -matches -sub -oc %%i >> %JobList%
    )

:END
    ENDLOCAL
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

cd %ProjectDir%

%DSbin%\dssh "SELECT NAME FMT '40L', CATEGORY FMT '35L' FROM DS_JOBS WHERE NAME NOT LIKE '\\%' ORDER BY CATEGORY, NAME;" >> %JobList%
might be easier as the inner command. Just an alternative. Thank you for the script.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
russ356
Charter Member
Charter Member
Posts: 38
Joined: Tue Jun 07, 2005 6:58 am

Post by russ356 »

I knew one of you wizards would know a better way but I couldn't find it yesterday. Thanks for the input Ray.
Post Reply