3

lets say i have a parameter file

[Global]
$$param1=x
$$param2=r
$$param3=t
$$param4=h
$$param5=j
$$Counter=0

what i want is whenever i run the session the parameter file updates and $Counter variable increments by 1 so that it be like this after the first run

[Global]
$$param1=x
$$param2=r
$$param3=t
$$param4=h
$$param5=j
$$Counter=1

and so on i searched alot but i didn't see clear answers for that some answers say i should use shell scripting but i didn't know how to use it in my case

Mark
  • 53
  • 4

1 Answers1

2

There are many ways to update these kind of param files.

  1. Use a scheduler like Oracle DAC/Automic/ControlM/Cybermation. They have a mechanism to update parameters daily. This is easy but if you are not willing to use a new tool, pls use option 2 or 3.

  2. Create a shell script which will update this param file in the beginning of the infa flow. You can create a CMD task or you can use it as pre session command task to the very first session of workflow. Shell script will be like

#!/bin/bash

param1=$1
param2=$2
param3=$3

sed -i -e "s/\(param1=\).*/\1$1/" \
-e "s/\(param2=\).*/\1$2/" \
-e "s/\(param3=\).*/\1$3/" global.prm

awk -i inplace -F"=" 'BEGIN{OFS=FS} $1=="Counter"{$2=$2+1}1' global.prm

Please test the script before using it.

  1. Use an informatica mapping to update the global param file. Create a mapping which will update this file and update the counter as well. And then use it to create a workflow and make sure it runs as first workflow of your chain of workflows.
Koushik Roy
  • 6,868
  • 2
  • 12
  • 33