Job Export - Through batch script

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Job Export - Through batch script

Post by myukassign »

Hi, I would like to take backup of my project everyday using an autoamted batch script scheduled to a windows scheduled task.

I am using the following command to export it and it is working fine as well. It connect to my unix datastage server and do the export automatically.

C:\Program Files\Ascential\DataStage7.5.2
dscmdexport.exe /H=10.000.000.00 /U=myid /P=password <project> C:\Bkup.dsx /V > C:\exportlog

But now I dont want the entire messy whole project to be exported, i want just a specific category in that.

for e.g if my project has 10 category folders like MyProj\Dev, MyProj\Test, MyProj\Promotion then I want only the MyProj\Dev folder only to be exported. Is it possible?
MVL
Premium Member
Premium Member
Posts: 33
Joined: Wed Apr 30, 2008 5:43 am

Re: Job Export - Through batch script

Post by MVL »

Check if this is possible:

connect to server
prepare the list of jobs that you need under a category
ftp the file back your client machine
run the dsexport
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Job Export - Through batch script

Post by chulett »

myukassign wrote:Is it possible?
Short answer? No.

Long answer? Yes, sortof. Export the whole project and then hack it up into the pieces you need. People here have written similar things, searching for "dsxcutter" (I believe) should turn one of them up.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Pierre
Participant
Posts: 66
Joined: Thu May 24, 2007 7:16 am
Location: Paris

Post by Pierre »

You can write a batch file that creates a list of categories and jobs using the following command :

dssh SELECT NAME FMT'80L', CATEGORY FMT'80L' FROM DS_JOBS WHERE CATEGORY LIKE '<YourCategory>' ORDER BY CATEGORY, NAME; > FileCat.txt

All you have to do after that is to read this file and export jobs.

I did it to create a csv file of Categories/jobs by projects, it works fine.

Pierre.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

There is a command called Dwn_ExecTCL.exe which can run this SQL statement from the client. So you could automate this whole process. This command is in Scripts.zip on my tips page. Do a search this has been covered in other posts.
Mamu Kim
Post Reply