cancel
Showing results for 
Search instead for 
Did you mean: 

Calling two global variable in file name

Former Member
0 Kudos

I need to call two Global variable inside the file name like

File_$GV_gp$GV_sn.txt

It can be accomplished using the Script object. We have too many intermediate files, is it possible to call the above line in the filename?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Concate those two variables.

Regards,

Gokul

Former Member
0 Kudos

Thanks.In order to do that, I created global variable and written the below line in SCRIPT object.


$G_variable='File_'||$GV_gp||$GV_sn||'.txt'

Called that global variable in the file format editor.

But my issue is, I have some 4-5 intermediate files, above case occurs for all the files. So in turn, I end up creating 4-5 global variable.Due to that,I need to pass the values for global variables in runtime.I don't want to specify values during runtime.

Is there is any other way, to play around with local variables?

Thanks

Former Member
0 Kudos

Hi Raja

I presume you mean "refer to" rather than "call" a global variable?

If you have a variable file name that is to be built at run time and then read or written by a file format at run time then your only real options are globals or parameters passed into the dataflow. You can pass local variables via dataflow parameters.

It is not clear from the way that you are asking the question what your issue is? Could you expand it a bit?

Former Member
0 Kudos

If you don't want to specify values during runtime. Then hardcoding is the option but it involves manual work every time you need to change something. This way your process will not be automated.


but it depends on how many times you're going to use that ETL or it just a one time requirement.


Regards,

Gokul

Former Member
0 Kudos

Hi Maurice,

Issue was solved. Instead of creating Global variable, I created Local variable and passed those values to parameters inside the data flow.

For instance:

$LV_Temp_file='File_'||$GV_gp||$GV_sn||'.txt'

Passed above local variable to parameter inside the data flow.

Thanks

Former Member
0 Kudos

Thank you Gokul. Issue was solved.

For instance:

$LV_Temp_file='File_'||$GV_gp||$GV_sn||'.txt'

Passed above local variable to parameter inside the data flow.

Answers (0)