Referencing input arguments in System Execute

Support/help with CloverETL (4.9) and CloverDX (5.0 or newer) implementation problems

daitienshi
Posts: 4
Joined: Fri Nov 04, 2011 5:48 pm

Referencing input arguments in System Execute

Postby daitienshi » Tue Feb 21, 2012 5:12 pm

Hi all,

My first post here, so please be gentle :)
I'm trying to execute a command in System Execute that references a value that I pass in from a Data Reader, but everything I've tried doesn't work.

I've made sure that I have set the input passthrough port, but nothing seems to work and I've tried all variations of syntax without any luck.

Any thoughts?

Thanks!

kubosj
Posts: 372
Joined: Thu Jan 12, 2012 9:10 am

Re: Referencing input arguments in System Execute

Postby kubosj » Wed Feb 22, 2012 11:05 am

Hi daitienshi,

please see attachment. Basically it work as this:
* all records sent to SystemExecute are collected
* then serialized into string and used as STDIN for your command
* if you need to handle dynamic parameters for your executables, you need to prepare bash script, which reads STDIN and convert it into parameters

In exaple graph is first branch for unix and second for windows.
Attachments
PullLogFromApp.grf
(3.27 KiB) Downloaded 638 times
Jaroslav Kubos
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com

daitienshi
Posts: 4
Joined: Fri Nov 04, 2011 5:48 pm

Re: Referencing input arguments in System Execute

Postby daitienshi » Wed Feb 22, 2012 2:43 pm

Hi Jarek,

Thanks for your quick reply.
Forgive me as I'm fairly new to this.
My data only has a single row and what I'm trying to do is extract specific fields in that record to feed into a command in my system execute.
Going through your example, I'm not quite sure how I would reference multiple fields from the input. How would I convert the STDIN into parameters, as you mentioned?

Also, when running your graph, the echo statement is not displayed in the console so I can't see that it's referencing the input value during the execution.

Thanks again for your help.
Chris

daitienshi
Posts: 4
Joined: Fri Nov 04, 2011 5:48 pm

Re: Referencing input arguments in System Execute

Postby daitienshi » Wed Feb 22, 2012 3:20 pm

Never mind.
I just did some more research into command line scripting and figured it out.
Thanks for all of your help!
Chris

kubosj
Posts: 372
Joined: Thu Jan 12, 2012 9:10 am

Re: Referencing input arguments in System Execute

Postby kubosj » Thu Feb 23, 2012 8:24 am

Just some notes for future generations :-)

* code in sample can be used also for one row - the for/while cycle will be executed just once
* in loop variable you can find whole line, delimited by character from metadata (e.g. "a|b|c")
* you need to parse it to get fields

also:
* output of echo commands in not visible in console because it is collected on output port of SystemExec component
Jaroslav Kubos
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com


cron