Page 1 of 1

Passing job parameter from text file

Posted: Sat Jun 30, 2007 2:46 pm
by rafik2k
Hi,
I want to read paramter from text file and use the value of paramter in my job.
Example
FileName is parameter

Code: Select all

Parameter name,prompt,value
domain_name,Enter value name domain, electricity
I tried searching in archive, but failed to get desired result.

Please let me know any reference of previous post or suggestion on same

Thanks

Posted: Sat Jun 30, 2007 2:56 pm
by ray.wurlod
Well, it's definitely been discussed before.

You can't do it within the job - job parameters are fixed when the job starts. Use whatever method you like in a job sequence to read the lines from the parameter file. Load these up into, say, user variables and use these to supply parameter values to the job.

Posted: Sat Jun 30, 2007 3:31 pm
by rafik2k
Thanks Ray!
I need to read all 3 variable
Parameter name,prompt,value
from first line and their corresponding value from 2nd file.

Can you pleae let me know or give me hints how to acheive this?
I believe I will have write the routine, but don't know the actual syntax of reading text file.

Thanks

Posted: Sat Jun 30, 2007 7:25 pm
by JoshGeorge
In the sequence you can call your routine by passing the file name, line number to be read and field number of the parameter. You can call this for all the parameters you want to read...

Code: Select all

Routine:

Open your seq file 
Ans = Trim(Field(FileLine,',',FieldNumber)) 
Close your seq file

Re: Passing job parameter from text file

Posted: Mon Jul 02, 2007 4:04 am
by sachin1
hello if your input parameters are fixed, say in number 1,2 ...3 or more, but thier values are stored in text file then, you can do is in JOB CONTROL use following

DSSetParam
DSRunJob
...DSDetachJob

you can read your file and set values for parameters using DSSetParam.