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