<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>CloverETL&#039;s Blog &#187; graph parameter</title>
	<atom:link href="http://blog.cloveretl.com/tag/graph-parameter/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cloveretl.com</link>
	<description>Life, the Universe, CloverETL and everything ...</description>
	<lastBuildDate>Thu, 15 Jul 2010 14:12:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.cloveretl.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/dd4c2411bcdf90b36e88bda58e3fce7c?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>CloverETL&#039;s Blog &#187; graph parameter</title>
		<link>http://blog.cloveretl.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.cloveretl.com/osd.xml" title="CloverETL&#039;s Blog" />
	<atom:link rel='hub' href='http://blog.cloveretl.com/?pushpress=hub'/>
		<item>
		<title>The Beauty of Inline CTL Expressions</title>
		<link>http://blog.cloveretl.com/2009/09/16/the-beauty-of-inline-ctl-expressions/</link>
		<comments>http://blog.cloveretl.com/2009/09/16/the-beauty-of-inline-ctl-expressions/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 14:19:30 +0000</pubDate>
		<dc:creator>Martin Janík</dc:creator>
				<category><![CDATA[Using CloverETL]]></category>
		<category><![CDATA[CTL]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[graph parameter]]></category>
		<category><![CDATA[new feature]]></category>

		<guid isPermaLink="false">http://blog.cloveretl.com/?p=182</guid>
		<description><![CDATA[Have you ever wondered how to write data records to a file with current date in its name? Then I&#8217;ve got a brand new solution for you! Since version 2.8, CloverETL supports inline CTL expressions within graph attributes and parameters. What does that mean? It means that you can use attributes and parameters containing CTL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.cloveretl.com&blog=7070972&post=182&subd=cloveretl&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Have you ever wondered how to write data records to a file with current date in its name? Then I&#8217;ve got a brand new solution for you! Since version 2.8, CloverETL supports inline CTL expressions within graph attributes and parameters. What does that mean? It means that you can use attributes and parameters containing CTL expressions which are evaluated dynamically at run-time!</p>
<p>Do you recall referencing graph parameters using the <code>${PARAM}</code> syntax? Using inline CTL expressions is even simpler! Let&#8217;s assume you&#8217;d like to store some data records to a unique file every day, e.g. <code>orders_2009-09-16.dat</code>. Changing the file name every day might be pretty annoying. Well, it&#8217;s much more pleasant to use an inline CTL expression. Take UniversalDataWriter for example and simply set its <code>fileURL</code> attribute to something like this:</p>
<blockquote><p><code>${DATAOUT_DIR}/orders_`date2str(today(), "yyyy-MM-dd")`.dat</code></p></blockquote>
<p>Notice the <code>`date2str(today(), "yyyy-MM-dd")`</code> part &#8212; that&#8217;s an inline CTL expression. Yes, that&#8217;s all you need to do! Just enclose your CTL expression within back quotes and place it anywhere you like. Except CTL transformations of course, that would be meaningless. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>The good news is that you can reference graph parameters from inline CTL expressions. Such graph parameters might again contain CTL expressions. And so forth&#8230; Assuming you defined parameters <code>FIRST_NAME</code> and <code>LAST_NAME</code>, defining another parameter, let&#8217;s say <code>FULL_NAME</code>, in the following way is perfectly valid:</p>
<blockquote><p><code>`substring('${FIRST_NAME}', 0, 1)`. ${LAST_NAME}</code></p></blockquote>
<p>Beware, two adjacent back quotes are treated as an empty CTL expression and always evaluated to an empty string. You might also ask how to use back quotes within inline CTL expressions. Well, it&#8217;s pretty straightforward, just escape them using a back slash, i.e. <code>\`</code>. (Both these features work since version 2.8.1.)</p>
<p>By default, evaluation of inline CTL expressions is turned on. If you want to turn this feature off for any reason, you can simply do so by setting the <code>GraphProperties.EXPRESSION_EVALUATION_ENABLED</code> configuration property to <code>false</code>.</p>
<p>We hope you&#8217;ll find this brand new feature useful! You can let us know where and why you use it by leaving a comment to this post.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cloveretl.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cloveretl.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cloveretl.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cloveretl.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cloveretl.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cloveretl.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cloveretl.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cloveretl.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cloveretl.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cloveretl.wordpress.com/182/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.cloveretl.com&blog=7070972&post=182&subd=cloveretl&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.cloveretl.com/2009/09/16/the-beauty-of-inline-ctl-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffdd9092938eaae7df4746ff4ab18d93?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">yanas</media:title>
		</media:content>
	</item>
		<item>
		<title>Hidden features: Environment variables in CloverETL transformation</title>
		<link>http://blog.cloveretl.com/2009/08/11/environment-variables-in-cloveretl-transformation/</link>
		<comments>http://blog.cloveretl.com/2009/08/11/environment-variables-in-cloveretl-transformation/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 12:43:52 +0000</pubDate>
		<dc:creator>Petr Uher</dc:creator>
				<category><![CDATA[Using CloverETL]]></category>
		<category><![CDATA[environment variable]]></category>
		<category><![CDATA[graph parameter]]></category>
		<category><![CDATA[Hidden features]]></category>

		<guid isPermaLink="false">http://blog.cloveretl.com/?p=92</guid>
		<description><![CDATA[Using environment variables &#8220;Environment variable is named value that can affect the way running process will behave on a computer.&#8221; In daily praxis we usually use environment variables with different syntax depending on operation system. On UNIX-like systems we use them with the syntax: $variable_name, on DOS and Windows systems the syntax is: %variable_name%. To [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.cloveretl.com&blog=7070972&post=92&subd=cloveretl&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<h2 style="text-align:left;">Using environment variables</h2>
<p style="text-align:center;"><em>&#8220;Environment variable is named value that can affect the way running process will behave on a computer.&#8221;</em></p>
<p>In daily praxis we usually use environment variables with different syntax depending on operation system. On UNIX-like systems we use them with the syntax: <code>$variable_name</code>, on DOS and Windows systems  the syntax is: <code>%variable_name%</code>. To list the variables on UNIX-like system we can use <code>env</code> shell command, on DOS and Windows systems <code>set</code> cmd command. You can find more general information on  environment variables at <a title="Wikipedie" href="http://en.wikipedia.org/wiki/Environment_variables" target="_blank">en.wikipedie.org</a>.<br />
But enough of general information. Now how we can use environment variables in CloverETL transformation? It&#8217;s very simple, you can use it in the same way as you routinely use <a href="http://www.cloveretl.com/_upload/clover-gui/docs/html/manual_html_chunk/ch13.html" target="_blank">graph parameters</a>. So if you want to add username of the user under whom the transformation is running to your processed data, it&#8217;s nothing more than adding a new field to metadata and write following in CTL (<a href="http://www.cloveretl.com/_upload/clover-gui/docs/html/manual_html_chunk/ch25.html" target="_blank">Clover Transformation Language</a>):</p>
<blockquote><p><code>function transform(){<br />
...<br />
$0.username := '${USER}'; //UNIX-like systems<br />
OR<br />
$0.username := '${USERNAME}'; //DOS and Windows systems<br />
...<br />
}</code></p></blockquote>
<p>But <strong>be careful</strong>, value of environment variables can contain &#8220;bad characters&#8221; (<code>\,"</code>) that have to be escaped by &#8216;<code>\</code>&#8216; in CloverETL. The safest way to use env variables in CloverETL is to enclose them in quotation marks  &#8216;<code>'</code>&#8216;.</p>
<h2>Overwriting environment variables &amp; priority of parameter definitions</h2>
<p>Often it&#8217;s very helpful to use environment variables inside CloverETL transformation. But sometimes you want to define your own graph parameter with the same name as the existing environment variable has. And you may ask the question: &#8220;Is it possible?&#8221;. I answer: &#8220;Yes, it is <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .&#8221; Because there is a hierarchy of graph parameter definitions:</p>
<ol>
<li>Parameter from external parameter file specified at the start of graph execution by <code>-cfg</code> option</li>
<li>Parameter defined at the start of graph execution by <code>-P</code> option</li>
<li>Parameter from external parameter file that is linked to the graph during the graph development</li>
<li>Internal graph parameter</li>
<li>Environment variable</li>
</ol>
<p>Parameter definitions from the list are sorted by  priority (highest to  lowest). So if you have internal graph parameter with the same name as the environment variable, the value from internal parameter is always used in CloverETL.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cloveretl.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cloveretl.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cloveretl.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cloveretl.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cloveretl.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cloveretl.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cloveretl.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cloveretl.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cloveretl.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cloveretl.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.cloveretl.com&blog=7070972&post=92&subd=cloveretl&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.cloveretl.com/2009/08/11/environment-variables-in-cloveretl-transformation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cec19d3aab248f6f4591a97277323f2c?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">puher</media:title>
		</media:content>
	</item>
	</channel>
</rss>