Thursday, 4 December 2014

Parameters Using Parameter/Value Set/Value File in Datastage


When a file based parameter set is used, the parameter set picks up the contents of the file at the time the job is started. This provides excellent flexibility as long job could manipulate a parameter set file, and leave new parameters for a subsequent job. The key is that the parameters are not compiled into the job or the parameter set. The following steps detail the creation and use of file based parameter sets.


The following steps detail the creation and use of file based parameter sets. 
File > New > Other > Parameter Set

In the general tab, name the parameter set. It should be alphanumeric and underscore characters only and no spaces
For example: my_file_parm_set



   1. In the Parameters tab, create the parameters and defaults


    2. In the Values tab, put the name of the file in the "Value File Name" column. Specify a file name only. No path component

Use alphanumeric characters etc. and no spaces. In the same row, list values for each parameter defined in the Parameters tab. The table should look like this:


         3. Click OK and save the parameter set.


      4. At this point the parameter set file should have been created using the following system:

Projects<project_name>/ParameterSets/<parm_nat_name>/<parm_file_name>

In our example the file name would be: InformationServer\Server\Projects\foo2\ParameterSets\my_file_parm_set\parm_file.txt
The contents of the file looks like this:
foo=Parm file value for foo
bar=Parm file value for bar 

In the job, navigate to Edit > Job Properties and select the Parameters tab. 

Click Add Parameter Set and select the newly created parameter set:


              
******Create the Sequence Job*****
      5. Create a new sequence and add a Job Activity stage to it. Double click on the stage to edit its properties then click on the button to select a Job name. 

    6. Once the job is loaded, its parameters become visible in the Parameters section of the Job Activity screen. The new parameter set should be in the list. Click on the drop down selector in the Value Expression column and select the parameter file:

Click OK and save the sequence.

      7. Now every time the sequence is run, parameters are read from the file at run time and passes to the job. Any preceding jobs in the sequence can change the file to dynamically modify the parameters.

Note: When the number of parameters in a parameter set is changed, all jobs using the parameter set must be recompiled.

*******************************************************************************

No comments:

Post a Comment