Page 1 of 1

Posted: Thu Jan 15, 2015 3:24 pm
by MrBlack
I'm having a hard time trying to understand what you are asking?

Can you parameterized a file name? - Yes. In the sequential stage properties you can reference a job parameter so when the job runs DS will dynamically look for the value of the parameter as the name of the file to load.

Can you insert a job parameter a column value in a transformer? Yes - instead of dragging a column from you source to your destination, just reference the job parameter instead.

Posted: Thu Jan 15, 2015 3:55 pm
by chulett
... and then there's this if (perhaps) you are talking about Parameter Value Files.

If you have a file with values in it that you want to bring into a job as Job Parameters then you'll need to read the file in some fashion and capture the output to pass in. It could be as simple as 'cat #filename#' in a Sequence... depends on exactly what is in your file.

Posted: Fri Jan 16, 2015 2:32 am
by hank_moody
Probably I poorly explained
I want to take in Parallel Job the value from file(*.ds or *.txt) via parameter.
Is it possible?
Or I should read value only via stages (Data_Set/Sequential_File)?
Thanks in advance

Posted: Fri Jan 16, 2015 8:35 am
by chulett
Still unclear, I'm afraid. However, your "I want to take" declaration is something I do believe I explained. If you don't agree, please be more specific... perhaps a fully fleshed out example of what you are trying to do would help in that case.

Posted: Fri Jan 16, 2015 9:10 am
by hank_moody
/opt/dsadm/project1:>cat file_tst.txt
"20000817"

In Designer I created parallel job.
In job properties I added parameter:
Parameter name: VAR1
Type: Pathname
Defaul value: /opt/dsadm/project1/file_tst.txt

In transformer stage I added derivation VAR1.
And in out stream I got the value: "/opt/dsadm/project1/file_tst.txt"
But I want to see: "20000817"

Posted: Fri Jan 16, 2015 10:45 am
by chulett
OK, that helps and is exactly what I explained how to do. Your job parameter needs to be appropriate for the actual value, nothing about how the parameters are passed will resolve things twice, so to speak. So... use a Sequence job to do the 'cat' and capture the output, then pass that output in as the job parameter value.

If you have any sort of 'job control framework' you could also code something up in a shell script to cat the value and then pass in the parameter as part of the dsjob invocation. If you are leveraging the API then look into:

DSAttachJob
DSSetParam
DSRunJob
DSDetachJob

All of this predicated on your need to pass this in as a job parameter. Depending on exactly what the job needs to do with this value and what else the job is doing, you may also be able to simply source from the file as you noted earlier.

Posted: Sat Jan 17, 2015 2:55 pm
by ray.wurlod
You might also like to investigate Parameter Sets and their associated values files. This is exactly the mechanism for which you are searching.

Posted: Mon Jan 19, 2015 2:25 am
by hank_moody
Thanks. I used a Sequence Job. It's works.

Parameter Set Values File Name

Posted: Wed Mar 23, 2016 8:08 am
by sauros73
I think this can help for some one searching that kind of subject.

If you check in the Values tab of a Parameter Set, the first field is called Value File Name.

This because the values of that tab are store on a text file on the server disk in the folder ../Projects/<project name>/ParameterSets/<Parameter Set Name>. The filename is the value of the " Values File Name"

I test it, and if you modified a value of a parameter in the Parameter Set=>Values tab=>Value File Name row, it is updated in the file on disk. And the opposite is true, if you modify the value on disk it is reflected in the Parameter Set.

That mean that if in your job you used the a particular Value File Name, you should be able to modified the value on disk (ex.: with a shell script) and it should be used by the job .

:!: :!: :!: :!: TO BE TESTED :!: :!: :!: :!:

Posted: Wed Mar 23, 2016 9:19 am
by chulett
Yup, exactly what they are meant for.

Posted: Wed Mar 23, 2016 4:34 pm
by ray.wurlod
I have many scenarios where the values files are updated from activities invoked from a controlling sequence before being used in job invoked from the same sequence.