Page 1 of 1

Job List with category

Posted: Fri Jan 11, 2008 8:36 am
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

Posted: Fri Jan 11, 2008 8:51 am
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.

Posted: Fri Jan 11, 2008 8:54 am
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.