Script to translate parameter names to their defaults

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
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Script to translate parameter names to their defaults

Post by PhilHibbs »

I have written a Perl script that I consider to be useful.

It generates another perl script from an input .xml export file created by DS Manager. It scans this xml file for job parameters, and the generated script will scan the Windows clipboard for parameter names e.g. #DIR# and will replace that text with the default parameter value.

For example, you can open up a Sequential File stage, click on the Input or Ourput tab, copy the file path to the clipboard, run this script (which can be bound to a shortcut key combination, I use Ctrl-Shift-P), and then paste the default file path from the clipboard into whatever text file or command prompt that you need it in. I mostly use it to FTP the files to my local machine.

There is one flaw in the plan: if multiple jobs have the same named parameter with different defaults, it will use the first one it finds in the xml file. I try to avoid this anyway. I will try to fix this by not translating parameters that appear multiple times with different values. These will have to be handled manually, or by different versions of the generated script.

Does this sound useful to anyone else? Is there a file area that I can upload this script to?

For now, it's on my web site:
http://www.hibbs.me.uk/parmclip.cmd

You need to redirect the output into the desired script file:

parmclip jobs.xml > c:/bin/clipparm.cmd
Last edited by PhilHibbs on Thu Feb 03, 2005 10:20 am, edited 3 times in total.
Phil Hibbs | Capgemini
Technical Consultant
Baldmartyr
Participant
Posts: 108
Joined: Mon Oct 21, 2002 8:30 am

Re: Script to translate parameter names to their defaults

Post by Baldmartyr »

PhilHibbs wrote: Is there a file area that I can upload this script to?
I'm sorry, Phil. We do not yet have an upload area.
David Baldwin
Former DSXchange Webmaster
Post Reply