Hi,
I have a requirement in which i have a file which has a COUNT value in it(There is only one record in the file).
In another job i want this COUNT value to be set as the default value of a Job Parameter. How can i achieve this?
Regards
Pulio
Extracting value from file,populating it as job parameter
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
-
- Participant
- Posts: 334
- Joined: Fri Dec 01, 2006 5:17 am
- Location: Texas
Your output file will have the count right?
If yes then you can use 'Before Job Subroutine' ...in that 'SetDSParamsFromFile'
For example
My output file is result.txt which will have count say 10
So use following unix command (before starting the next job)
This will create your parameter file.
1.Then under the 'General' tab, set the 'Before Job Subroutine' to be 'SetDSParamsFromFile'
2.The routine takes two arguments (a directory and a file name) which are comma separated.
example : /home/dev/test/,JobParam.txt
The above can also be transformed into job parameters with defaults assigned to them
eg :You can use argument as #Parameter_Name# where Parameter_Name is the parameter defined in the job
3." The Job Parameter file format is as follows:
<parameter-name> = <parameter-value>
E.g. Parameter_Name=10
Hope this will solve your problem...![Wink :wink:](./images/smilies/icon_wink.gif)
![Confused :?](./images/smilies/icon_confused.gif)
If yes then you can use 'Before Job Subroutine' ...in that 'SetDSParamsFromFile'
For example
My output file is result.txt which will have count say 10
So use following unix command (before starting the next job)
Code: Select all
count=`cat result.txt`
echo Parameter_Name=$count > /home/dev/test/JobParam.txt
cat /home/dev/test/JobParam.txt
Parameter_Name=10
1.Then under the 'General' tab, set the 'Before Job Subroutine' to be 'SetDSParamsFromFile'
2.The routine takes two arguments (a directory and a file name) which are comma separated.
example : /home/dev/test/,JobParam.txt
The above can also be transformed into job parameters with defaults assigned to them
eg :You can use argument as #Parameter_Name# where Parameter_Name is the parameter defined in the job
3." The Job Parameter file format is as follows:
<parameter-name> = <parameter-value>
E.g. Parameter_Name=10
Hope this will solve your problem...
![Wink :wink:](./images/smilies/icon_wink.gif)
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)