Import Jobs from Command line
Moderators: chulett, rschirm, roy
Import Jobs from Command line
Hi,
I have a dsx which contains one Job design exported from Datastage Manager. My aim is to import this job design from command line and not through Datastage manager. I checked the documentation and I was able to import the Job executables rather than Job designs. So when I import job executables I am not able to see them in designer as I do not have designer details.
Please let me know if I can import job designs from command line.
I have a dsx which contains one Job design exported from Datastage Manager. My aim is to import this job design from command line and not through Datastage manager. I checked the documentation and I was able to import the Job executables rather than Job designs. So when I import job executables I am not able to see them in designer as I do not have designer details.
Please let me know if I can import job designs from command line.
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I will post a couple of scripts soon which are based on the backup batch file DataStageBackup.bat. My current customer does not use Version Control. So I modified that script to load all DSX files in a directory. The Directory is the project name. It uses my current directory structure so you need to modify it to use something other than.
C:\DataStage\KimD\Scripts
C:\DataStage\KimD\Backups\MyProject
So you will need a directory for each project.
We have a migration document which gives the list of jobs and routines to move. So I can also export all jobs in a text file called JobList.txt.
C:\DataStage\KimD\Backups\MyProject\JobList.txt
So I should post DataStageImporter.bat and DataStageExporter.bat this weekend. Hopefully someone will need these.
We should add the check in to CVS soon. Let you know when we automate that.
By the way thanks to these guys for the original script:
Manoli Krinos
M Ruland
T.J. Griesenbrock
C:\DataStage\KimD\Scripts
C:\DataStage\KimD\Backups\MyProject
So you will need a directory for each project.
We have a migration document which gives the list of jobs and routines to move. So I can also export all jobs in a text file called JobList.txt.
C:\DataStage\KimD\Backups\MyProject\JobList.txt
So I should post DataStageImporter.bat and DataStageExporter.bat this weekend. Hopefully someone will need these.
We should add the check in to CVS soon. Let you know when we automate that.
By the way thanks to these guys for the original script:
Manoli Krinos
M Ruland
T.J. Griesenbrock
Mamu Kim
Hi Ray,Duke,
We are using Enterprise Edition of 7.5.1.A.
Actually, I have to give solution to my client by end of day today or we have to find some other solution.
My client doesn't use version control of Datastage. They use PVCS to store the DSX and wish to automate the process of taking the latest version of DSX and move them to QA/Prod using this import script. If you can give me some clue how to do it I can at least tell them the time required for completion of this automated process.
Thanks for your help.
We are using Enterprise Edition of 7.5.1.A.
Actually, I have to give solution to my client by end of day today or we have to find some other solution.
My client doesn't use version control of Datastage. They use PVCS to store the DSX and wish to automate the process of taking the latest version of DSX and move them to QA/Prod using this import script. If you can give me some clue how to do it I can at least tell them the time required for completion of this automated process.
Thanks for your help.
Thanks
I am sorry. I forgot to copy these scripts to my thumb drive. Will do it tomorrow.
You need to start with DataStageBackup.bat. Next you need to modify to dsimport.exe on the DataStageImporter.bat and dsexport.exe. (I think) You need to cd into the correct directory. Next you a list of jobs or DSX files.
DIR *.dsx > DsxList.txt
or
edit JobList.txt
Next you need to change the for loop to use either DsxList.txt or JobList.txt. Next execute the command above with either the dsx file or /JOB=%%i. So the code looks like:
Changes to
You need to start with DataStageBackup.bat. Next you need to modify to dsimport.exe on the DataStageImporter.bat and dsexport.exe. (I think) You need to cd into the correct directory. Next you a list of jobs or DSX files.
DIR *.dsx > DsxList.txt
or
edit JobList.txt
Next you need to change the for loop to use either DsxList.txt or JobList.txt. Next execute the command above with either the dsx file or /JOB=%%i. So the code looks like:
Code: Select all
for /F "tokens=1" %%i in (%ProjectList%) do (
ECHO Backing up Project %%i
%DSExportCmd% /H=%Host% /U=%User% /P=%Password% %%i %BackupDir%%DsxDate%\%Host%_%%i.dsx >> %LogFileName%
IF NOT %ERRORLEVEL%==0 GOTO ProjFail
ECHO. >> %LogFileName%
ECHO *** Completed Export for Project: %%i on Host: %Host% >> %LogFileName%
ECHO to File: %BackupDir%%DsxDate%\%Host%-%%i.dsx >> %LogFileName%
ECHO. >> %LogFileName%
)
Code: Select all
for /F "tokens=1" %%i in (%JobList%) do (
ECHO Backing up Project %%i
%DSExportCmd% /H=%Host% /U=%User% /P=%Password% /JOB=%%i %Project% %%i.dsx >> %LogFileName%
IF NOT %ERRORLEVEL%==0 GOTO ProjFail
ECHO. >> %LogFileName%
ECHO *** Completed Export for Project: %%i on Host: %Host% >> %LogFileName%
ECHO to File: %BackupDir%%DsxDate%\%Host%-%%i.dsx >> %LogFileName%
ECHO. >> %LogFileName%
)
Mamu Kim
Hi Kim,
Below is process we are trying to follow for moving the jobs from Development to QA
1) Developer will Export the jobs using Datastage Manager into .dsx format
2) Developer will Check In the dsx into PVCS
3) QA will get the latest version of dsx from PVCS and move them into QA
This process of moving the jobs from PVCS to QA is to be automated and it should be flexible to import only one job or multiple jobs in a loop. This is because we may fix one odd job and then move into QA for testing.
We need actual Job designs to move to QA
I studied your DataStageBackup.bat script, it does whole backup of a project. It would be a great help for us to take the backups.
Syntax for Getting the dsx from PVCS is as below
get -r file_name ( this will get the specific revison of the file)
To put the files into PVCS the command is
put -f file_name ( this will check in the file even if it is not changed)
I will wait for you to post dsimport.exe on the DataStageImporter.bat and dsexport.exe
Below is process we are trying to follow for moving the jobs from Development to QA
1) Developer will Export the jobs using Datastage Manager into .dsx format
2) Developer will Check In the dsx into PVCS
3) QA will get the latest version of dsx from PVCS and move them into QA
This process of moving the jobs from PVCS to QA is to be automated and it should be flexible to import only one job or multiple jobs in a loop. This is because we may fix one odd job and then move into QA for testing.
We need actual Job designs to move to QA
I studied your DataStageBackup.bat script, it does whole backup of a project. It would be a great help for us to take the backups.
Syntax for Getting the dsx from PVCS is as below
get -r file_name ( this will get the specific revison of the file)
To put the files into PVCS the command is
put -f file_name ( this will check in the file even if it is not changed)
I will wait for you to post dsimport.exe on the DataStageImporter.bat and dsexport.exe
Thanks
Hi Kim,
I implemented the import script and working fine when I run it from the DOS prompt.
As mentioned before I am using PVCS mover option to import these jobs by selecting the latest dsx from PVCS.
Now, what is happening is when Datastage tries to import jobs it shows some prompts which has to be clicked yes or no so that the job is imported.
Issue here is when I use ETL Mover option of PVCS, this prompt is not shown to the user as it is triggered from 3rd party tool and becos the user doesn't respond, Datstage waits for response and hangs.
Can you please help me in resloving or suppressing this responses as PVCS doesn't show these prompts becos the script is run in background.
I implemented the import script and working fine when I run it from the DOS prompt.
As mentioned before I am using PVCS mover option to import these jobs by selecting the latest dsx from PVCS.
Now, what is happening is when Datastage tries to import jobs it shows some prompts which has to be clicked yes or no so that the job is imported.
Issue here is when I use ETL Mover option of PVCS, this prompt is not shown to the user as it is triggered from 3rd party tool and becos the user doesn't respond, Datstage waits for response and hangs.
Can you please help me in resloving or suppressing this responses as PVCS doesn't show these prompts becos the script is run in background.
Thanks
I would try adding this to your command line.
Let me know if it works.
Code: Select all
/O=1
Mamu Kim
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: