Command Line arguments for a Command Stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 27
- Joined: Sun Mar 20, 2005 4:23 am
- Location: Brisbane, Australia
Command Line arguments for a Command Stage
I have a command stage with an input of a seq file.
My question:
I know how to use job parameters in the command line (#PARAM#), but how do i use the row values from the input seq file as a value in the command line?
My question:
I know how to use job parameters in the command line (#PARAM#), but how do i use the row values from the input seq file as a value in the command line?
Hello Mick,
I think that if you have a sequential file with a column such as "MyParamValue" then you could use a Transform stage with a before or after stage routine call to which you can pass the value of the column, then from the routine use DSAttach and DSCallJob to pass this on to another job.
I think that if you have a sequential file with a column such as "MyParamValue" then you could use a Transform stage with a before or after stage routine call to which you can pass the value of the column, then from the routine use DSAttach and DSCallJob to pass this on to another job.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Consider using the new Set Variables stage in your sequence job to retrieve your parameters from the file. Write a routine that opens a file and retrieves a named parameter. Call this routine from your Variables stage for each parameter you need to retrieve. Insert these Variables into your Command stage with the syntax VariablesStageName.VariableName.
With version 7.5 you can retrieve parameters from files from within a Job Activity stage or a Variables stage.[/i]
With version 7.5 you can retrieve parameters from files from within a Job Activity stage or a Variables stage.[/i]
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
-
- Participant
- Posts: 27
- Joined: Sun Mar 20, 2005 4:23 am
- Location: Brisbane, Australia
Sorry, I am new to DS (2 weeks). So i must admit this is all 'gobeldy-gook' to me.
is the Variables stage the User Variables Activity? I do not have a Variable Stage in my DSJob pallette!
Any chance of stating all the items I would need and their joins - I can work on the detail!!!
Do I need?:
1. start loop activity
2. set variable from a routine??
3. 'Execute Command stage' using the variable from variable stage??
4. end loop activity
****************
Consider using the new Set Variables stage in your sequence job to retrieve your parameters from the file. Write a routine that opens a file and retrieves a named parameter. Call this routine from your Variables stage for each parameter you need to retrieve. Insert these Variables into your Command stage with the syntax VariablesStageName.VariableName .
With version 7.5 you can retrieve parameters from files from within a Job
Activity stage or a Variables stage.[/i]
is the Variables stage the User Variables Activity? I do not have a Variable Stage in my DSJob pallette!
Any chance of stating all the items I would need and their joins - I can work on the detail!!!
Do I need?:
1. start loop activity
2. set variable from a routine??
3. 'Execute Command stage' using the variable from variable stage??
4. end loop activity
****************
Consider using the new Set Variables stage in your sequence job to retrieve your parameters from the file. Write a routine that opens a file and retrieves a named parameter. Call this routine from your Variables stage for each parameter you need to retrieve. Insert these Variables into your Command stage with the syntax VariablesStageName.VariableName .
With version 7.5 you can retrieve parameters from files from within a Job
Activity stage or a Variables stage.[/i]
-
- Participant
- Posts: 27
- Joined: Sun Mar 20, 2005 4:23 am
- Location: Brisbane, Australia
My last post was a little unclear:
What I want to do is:
1. Populate a text file with some values (eg: List of all the projects on the server
#PROG_DIR#\DsJob.exe -server #HOST# -user #UID# -password #PWD# -lprojects > #EXPORT_DIR#\PL.txt
)
2. Loop through each of the values in the text file and call a command (eg: for each project on the server - create file with a list of job in each project
#PROG_DIR#\DsJob.exe -server #HOST# -user #UID# -password #PWD# -ljobs #Project# > #EXPORT_DIR#\#Project#\JL.txt
)
3. Open each file with the job list in it and export the bitmaps for each job into a separate directory using cmd DsDesign.exe /H=#HOST# /U=#UID# /P=#PWD# /SaveAsBmp=#EXPORT_DIR#\#Job#\#Job#_bmp.bmp #Project# #Job#
Can anyone give me guidance on the bast way to achive this using DS stages and not Basic?
What I want to do is:
1. Populate a text file with some values (eg: List of all the projects on the server
#PROG_DIR#\DsJob.exe -server #HOST# -user #UID# -password #PWD# -lprojects > #EXPORT_DIR#\PL.txt
)
2. Loop through each of the values in the text file and call a command (eg: for each project on the server - create file with a list of job in each project
#PROG_DIR#\DsJob.exe -server #HOST# -user #UID# -password #PWD# -ljobs #Project# > #EXPORT_DIR#\#Project#\JL.txt
)
3. Open each file with the job list in it and export the bitmaps for each job into a separate directory using cmd DsDesign.exe /H=#HOST# /U=#UID# /P=#PWD# /SaveAsBmp=#EXPORT_DIR#\#Job#\#Job#_bmp.bmp #Project# #Job#
Can anyone give me guidance on the bast way to achive this using DS stages and not Basic?
-
- Participant
- Posts: 85
- Joined: Fri Jun 04, 2004 2:30 am
- Location: Melbourne, Australia
- Contact:
Welcome aboard!
I think what you are trying to do is export some information about your existing jobs in a certain project?
If so, <a href="http://www.kennethbland.com">Kenneth Bland</a> has some great utilities for this. No point re-inventing the wheel. Register on his site and have a look around. Even if it's not what you need since you do not have a lot of experience in Datastage it might give you some insight as to how to extract the information that you need.
I think what you are trying to do is export some information about your existing jobs in a certain project?
If so, <a href="http://www.kennethbland.com">Kenneth Bland</a> has some great utilities for this. No point re-inventing the wheel. Register on his site and have a look around. Even if it's not what you need since you do not have a lot of experience in Datastage it might give you some insight as to how to extract the information that you need.
Cheers,
Dave Nemirovsky
Dave Nemirovsky
-
- Participant
- Posts: 27
- Joined: Sun Mar 20, 2005 4:23 am
- Location: Brisbane, Australia
-
- Participant
- Posts: 85
- Joined: Fri Jun 04, 2004 2:30 am
- Location: Melbourne, Australia
- Contact:
Wouldn't you hide the code? No good giving away your hard earned experience to just anybody.
Back to your conceptual question:
I am almost certain that points 1 & 2 can be designed through a datastage job.
1) This job might look like this:
In the UV stage you will need to figure out the UV SQL statement that will retrieve list of projects.
2) This job might look like this:
Inside this transformer you will need to write a routine that accepts a 'Project' name and returns a delimited list of jobs. These jobs will be listed in the 2nd Seq file (job name file).
3) I think you should be able to write another routine that accepts a valid Job name and a path and then outputs the BMP to that path.
Back to your conceptual question:
I am almost certain that points 1 & 2 can be designed through a datastage job.
1) This job might look like this:
Code: Select all
UV stage --> Xfer --> Seq
2) This job might look like this:
Code: Select all
Seq --> Xfer --> Seq
3) I think you should be able to write another routine that accepts a valid Job name and a path and then outputs the BMP to that path.
Cheers,
Dave Nemirovsky
Dave Nemirovsky
-
- Participant
- Posts: 18
- Joined: Mon Nov 25, 2002 3:23 am
- Location: Switzerland
Hello
Did you consider using the Environment Variables? There is a file called DSParams in each project. The DS Administrator defines user variables available to each job in the project. Variables will typically have the same names but different values depending on the project. Dynamic retrieval of the environment variable is done through a routine. (in version 7 GetEnvironment(variablename) ).
Did you consider using the Environment Variables? There is a file called DSParams in each project. The DS Administrator defines user variables available to each job in the project. Variables will typically have the same names but different values depending on the project. Dynamic retrieval of the environment variable is done through a routine. (in version 7 GetEnvironment(variablename) ).
mickboland wrote:My last post was a little unclear:
What I want to do is:
1. Populate a text file with some values (eg: List of all the projects on the server
#PROG_DIR#\DsJob.exe -server #HOST# -user #UID# -password #PWD# -lprojects > #EXPORT_DIR#\PL.txt
)
2. Loop through each of the values in the text file and call a command (eg: for each project on the server - create file with a list of job in each project
#PROG_DIR#\DsJob.exe -server #HOST# -user #UID# -password #PWD# -ljobs #Project# > #EXPORT_DIR#\#Project#\JL.txt
)
3. Open each file with the job list in it and export the bitmaps for each job into a separate directory using cmd DsDesign.exe /H=#HOST# /U=#UID# /P=#PWD# /SaveAsBmp=#EXPORT_DIR#\#Job#\#Job#_bmp.bmp #Project# #Job#
Can anyone give me guidance on the bast way to achive this using DS stages and not Basic?
On 3. you can download DSaveAsBmp.bat on my tips page. It will run the command on every job in a project. It is a DOS batch file. It runs dsjob to get a list of jobs then runs the Designer.exe on each job in the project. Saves lots of time. This files can be used by the GenHtml jobs also on my tips page to generate a html document on each job. It runs JobReport on each job.
Mamu Kim
need some more idea on Routine in PX
I was looking to solve same kind of situation....
I need more specific information on the (write a routine) is that a UNIX or DS routine...
Plz tell me more about that routine.. that will is helpful..
My question is to get the receipts mailids from a flat file to notification activity.
ENV:7.5.1 in PX
Thanks in adv
I need more specific information on the (write a routine) is that a UNIX or DS routine...
Plz tell me more about that routine.. that will is helpful..
My question is to get the receipts mailids from a flat file to notification activity.
ENV:7.5.1 in PX
Thanks in adv
vmcburney wrote:Consider using the new Set Variables stage in your sequence job to retrieve your parameters from the file. Write a routine that opens a file and retrieves a named parameter. Call this routine from your Variables stage for each parameter you need to retrieve. Insert these Variables into your Command stage with the syntax VariablesStageName.VariableName.
With version 7.5 you can retrieve parameters from files from within a Job Activity stage or a Variables stage.[/i]