<?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/"
	>

<channel>
	<title>George Papayiannis &#187; IBM</title>
	<atom:link href="http://www.sematopia.com/category/work/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sematopia.com</link>
	<description></description>
	<lastBuildDate>Mon, 21 Nov 2011 23:18:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Talks @ TEC 2007</title>
		<link>http://www.sematopia.com/2007/04/talks-tec-2007/</link>
		<comments>http://www.sematopia.com/2007/04/talks-tec-2007/#comments</comments>
		<pubDate>Mon, 16 Apr 2007 18:49:10 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[i5]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[iSeries]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=184</guid>
		<description><![CDATA[I&#8217;ll be presenting this Tuesday (tomorrow) and Wednesday at TEC 2007. I have 3 talks in total: How do you know when to use use PHP/CGI/WebSphere? Confused about all the options for iSeries Web Development such as PHP, CGI and WebSphere? Each has it&#8217;s own advantages and disadvantages and understanding what these are will help [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tug.ca/tec/Speakers/2007PapayiannisGeorgeA.html">I&#8217;ll be</a> presenting this Tuesday (tomorrow) and Wednesday at <a href="http://www.tug.ca/tec/">TEC 2007</a>.<br />
I have 3 talks in total:</p>
<p><strong>How do you know when to use use PHP/CGI/WebSphere?</strong></p>
<p>Confused about all the options for iSeries Web Development such as PHP, CGI and WebSphere? Each has it&#8217;s own advantages and disadvantages and understanding what these are will help you choose the right one for the task at hand.  This session will provide an introduction to PHP, CGI and WebSphere cover their advantage, disadvantages and other information to help you make the right choice.  Co-Presenter: Don Yantzi</p>
<p><strong>PHP For RPG Programmers</strong></p>
<p>PHP is an open source web scripting/programming language used to create powerful web based applications. PHP takes the idea of rapid application development to the next level and is revolutionizing they way people make and think about web application.  This session will provide RPG programmers with the insight needed to leverage their existing RPG knowledge and create fast, effective and secure web applications.</p>
<p><strong>Web 2.0 for System i</strong></p>
<p>Wikis, blogs, AJAX, The Long Tail&#8230; What is Web 2.0? And how does it related to System i?  Web 2.0 is considered to be the second wave of the World Wide Web and its services. Web 2.0 highlights the role of the web as a platform, as well as a social collaborative medium for connecting people with other people, their content, media, and products.  In this session we&#8217;ll look at examples of Web 2.0 related technologies and concepts to help define what Web 2.0 is all about. Then we&#8217;ll briefly explore how Web 2.0 can be produced and consumed with System i.  Co-Presenter: Abe Batthish </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2007/04/talks-tec-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WDSC Development Team blog</title>
		<link>http://www.sematopia.com/2007/03/wdsc-development-team-blog/</link>
		<comments>http://www.sematopia.com/2007/03/wdsc-development-team-blog/#comments</comments>
		<pubDate>Wed, 14 Mar 2007 16:01:52 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[i5]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[iSeries]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=179</guid>
		<description><![CDATA[As I touched on in my bio, I work at IBM on the team which develops the WebSphere Development Studio Client (WDSC). Yesterday my team/area launched our team blog (WDSC Development Team). As the name implies, this blog is a collaborative effort amongst numerous people in my area. We have big things planned for this [...]]]></description>
			<content:encoded><![CDATA[<p>As I <a href="http://www.sematopia.com/?page_id=79">touched on in my bio</a>, I work at IBM on the team which develops the WebSphere Development Studio Client (WDSC).  Yesterday my team/area launched our team blog (<a href="http://wdsc.wordpress.com/">WDSC Development Team</a>).  As the name implies, this blog is a collaborative effort amongst numerous people in my area.  We have big things planned for this blog, and hope to facilitate a lively discussion amongst members of the community.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2007/03/wdsc-development-team-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tech Talk: Dojo JavaScript Toolkit slides</title>
		<link>http://www.sematopia.com/2007/03/tech-talk-dojo-javascript-toolkit-slides/</link>
		<comments>http://www.sematopia.com/2007/03/tech-talk-dojo-javascript-toolkit-slides/#comments</comments>
		<pubDate>Thu, 01 Mar 2007 16:42:48 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Device UI]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=175</guid>
		<description><![CDATA[I&#8217;m giving a tech talk today at work on a JavaScript Toolkit called Dojo. I made the slides based off of the dojo.book documentation. I uploaded the slides to Zoho, you can see them below. Hit the button in the bottom corner to maximize the presentation.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m giving a tech talk today at work on a <a href="http://dojotoolkit.org/">JavaScript Toolkit called Dojo</a>.  I made the slides based off of the <a href="http://manual.dojotoolkit.org/WikiHome/DojoDotBook/BookIntroduction">dojo.book documentation</a>.  I uploaded the slides to Zoho, you can see them below.  Hit the button in the bottom corner to maximize the presentation.</p>
<p><iframe src="http://show.zoho.com/ViewURL.sas?USER=papayiya&#038;DOC=dojo-tech-talk-ppt&#038;IFRAME=yes" height='370' width='480' name="dojo-tech-talk-ppt" scrolling=no frameBorder='0' ></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2007/03/tech-talk-dojo-javascript-toolkit-slides/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Family going for a walk..</title>
		<link>http://www.sematopia.com/2007/02/family-going-for-a-walk/</link>
		<comments>http://www.sematopia.com/2007/02/family-going-for-a-walk/#comments</comments>
		<pubDate>Thu, 01 Mar 2007 06:19:57 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[Pictures]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=174</guid>
		<description><![CDATA[On my way to work last summer (same place as now, IBM Toronto Lab), I had to maneuver an unfamiliar obstacle in the parking lot. It looks like the family was out for a morning stroll.]]></description>
			<content:encoded><![CDATA[<p>On my way to work last summer (same place as now, IBM Toronto Lab), I had to maneuver an unfamiliar obstacle in the parking lot.  It looks like the family was out for a morning stroll.<br />
<a href="http://www.flickr.com/photos/papayiannis/406085603/in/set-72157594562483105/"><br />
<img src="http://farm1.static.flickr.com/161/406085603_9f5295db1c_o.jpg" alt="ducks" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2007/02/family-going-for-a-walk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Insight into how System i budget spent</title>
		<link>http://www.sematopia.com/2006/11/insight-into-how-system-i-budget-spent/</link>
		<comments>http://www.sematopia.com/2006/11/insight-into-how-system-i-budget-spent/#comments</comments>
		<pubDate>Fri, 03 Nov 2006 19:10:50 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[i5]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[iSeries]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=156</guid>
		<description><![CDATA[I came across a good article from ITJungle, that interviews Elaine Lennox (VP of marketing for System i). The article talks about iSociety, The Truth site, the $10m print ads rolling out, the push to port all IBM software to i5, how the TV ads went, and more. Most importantly it gives some insight into [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a good <a href="http://www.itjungle.com/tfh/tfh103006-story02.html">article from ITJungle</a>, that interviews Elaine Lennox (VP of marketing for System i).  The article talks about <a href="http://isociety.common.org/">iSociety</a>, <a href="http://www-03.ibm.com/systems/i/iwantcontrol/truth/">The Truth site</a>, the $10m print ads rolling out, the push to port all IBM software to i5, how the TV ads went, and more.  <strong>Most importantly</strong> it gives some insight into the budget and how the money is spent.</p>
<blockquote><p>
Elaine Lennox is happy and excited to have a job that comes with a uniform. It&#8217;s red and white with concentric circles and a big blue bull&#8217;s eye in the middle of her back. Most people would describe it as a target. But Lennox, who also wears the title of vice president of marketing for the System i division at IBM, isn&#8217;t hiding from anyone. She&#8217;s used to the rock throwers, the outspoken critics with pointy sticks, and the heat about below average marketing of the platform.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/11/insight-into-how-system-i-budget-spent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Friday wrap-up #3</title>
		<link>http://www.sematopia.com/2006/10/friday-wrap-up-3/</link>
		<comments>http://www.sematopia.com/2006/10/friday-wrap-up-3/#comments</comments>
		<pubDate>Sun, 29 Oct 2006 02:22:03 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Corporate]]></category>
		<category><![CDATA[Friday]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[iSeries]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=155</guid>
		<description><![CDATA[This was a busy week, a lot of catching up from all the time spent at CASCON last week. Continuing on from last week, I&#8217;ve gotten more intimate (?) with Dojo and its inner workings. I wrote about Dojo a couple months ago, and I&#8217;m still really impressed with everything going on there. A lot [...]]]></description>
			<content:encoded><![CDATA[<p>This was a busy week, a lot of catching up from all the time spent at CASCON last week.  Continuing on from last week, I&#8217;ve gotten more intimate (?) with Dojo and its inner workings.  I wrote about Dojo a couple months ago, and I&#8217;m still really impressed with everything going on there.  A lot of big name sites are built off this toolkit, including Meebo.</p>
<p>IBM results came out last week, the System i had a rough quarter, but IBM did well overall.  Last year at this time (3Q05) the System i had a break out quarter due to an upgrade cycle.  This  year (3Q06) there were no new upgrades and results were the same as 3Q04.  This <a href="http://www.systeminetwork.com/article/news/53420/index.html">article sums things up</a>:</p>
<blockquote><p>
IBM revenue for the System i fell 22 percent in the third quarter of 2006, or 23 percent at constant currency when compared to the same period of 2005. At the same time, nearly every other major IBM business unit saw revenue increase. Overall, earnings rose 47 percent compared to the previous year, up to $2.22 billion on revenues of $22.6 billion, which were up 5 percent.</p>
<p>The supply chain issues IBM faced in the second quarter of this year for System i sales, which were connected to a 7 percent drop in revenue for System i over the second quarter of 2005, have cleared up. IBM CFO Mark Loughridge noted that IBM&#8217;s supply chain did a superb job delivering System p, i, z, and storage but faltered over System x deliveries, contributing to the low rise of 4 percent for the System x. System p revenues increased 10 percent, and System z was a breakout star with a 25 percent increase in revenues while IBM delivered a 16 percent increase in System z MIPS (millions of instructions per second).</p>
<p>For the System i, IBM says 3Q06 compares to a particularly strong 3Q05 quarter, which was driven by upgrade activity from a fully refreshed roadmap, which in turn caused slowing revenue as customers leveraged those previous upgrades. Overall, IBM notes that System i revenue performance remains dependent upon cyclical upgrades.
</p></blockquote>
<p>I was at a Halloween fund raiser for Diabetes last night, it was a good time for a good cause.  I&#8217;m amazed that no matter what type of social event I may be at, there&#8217;s always someone thats directly involved with the System i in some way.</p>
<p>In other news, RedHat got murdered this week in the markets.  Cisco announced they would be creating a fork the RedHat&#8217;s version of Linux and providing half price support until the new year.  If any good can be seen out of this, it just re-affirms RedHat&#8217;s dominance in the Enterprise Linux market.</p>
<p>FireFox 2 came out this week, it generally seems more responsive, but definitely not as polished as it should be.  The memory leak issue doesn&#8217;t seem to have been fixed, since as I type FireFox is using upwards of 80mb memory and climbing.  The new spell checking feature is great though, any work misspelled get underlined in red, right click the and suggestions appear.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/10/friday-wrap-up-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Friday wrap-up #1</title>
		<link>http://www.sematopia.com/2006/10/friday-wrap-up-1/</link>
		<comments>http://www.sematopia.com/2006/10/friday-wrap-up-1/#comments</comments>
		<pubDate>Fri, 13 Oct 2006 19:29:36 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Friday]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=151</guid>
		<description><![CDATA[Update (Nov. 18 2006): I&#8217;ll try and do this weekly, but no guarantees. Last thing I want to do is write another AJAX framework, but it seems that’s the only way to fully understand large-scale AJAX development. We&#8217;ll see what happens &#8212; I&#8217;ve spent a lot of time looking into Object Notations (ON) (JSON, YAML, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong> (Nov. 18 2006): I&#8217;ll try and do this weekly, but no guarantees.</p>
<p>Last thing I want to do is write another AJAX framework, but it seems that’s the only way to fully understand <strong>large-scale</strong> AJAX development.  We&#8217;ll see what happens &#8212; I&#8217;ve spent a lot of time looking into Object Notations (ON) (JSON, YAML, etc.) this past week, weighing out trade-offs between run-time extensions to server side scripts.  I&#8217;ve been getting a lot of people asking for another AJAX tutorial to continue from the original &#8212; I&#8217;ll try and write something soon.</p>
<p>This past Tuesday, I sat in on the 3rd and final Technology Showcase my 2nd line manager had organized.  This one in particular was on C, C++, and Fortran Compilers.  A lot of cool stuff in the works, we even got a demo (video) of the <strong>PS3</strong> in action.</p>
<p>Motivated by Ryan&#8217;s idea of <a href="http://blogs.gnome.org/view/ryanl/2005/12/04/0">KeyboardCast</a>, I made a couple suggestions to the Target Management (Remote Systems Explorer) subproject in Eclipse, about being able to execute a single shell command on multiple servers (or targets).  After some discussions, agreeing to help out in specs/code/discussions, I got sucked into testing for their 1.0 release!  Ah, it was ok, I had a small commitment of 2 hours.</p>
<p>I finally submitted my 2nd application for a patent @ IBM.  Considering the backlog at the US patent office is something ridiculous like 2+ years &#8212; I have a while to wait.  The patent is for a revolutionary new type of XML Parser that a manager and I came up with &#8212; that’s all I can say about it now.</p>
<p>Next week is the <a href="https://www-927.ibm.com/ibm/cas/cascon/index.shtml">CASCON</a> conference.  Aside from the keynotes and walk-in talks, I&#8217;ve signed up for 3 workshops:</p>
<ul>
<li>Hands-on: Building a Ruby on Rails application with DB2 Express-C 9</li>
<li>Social Computing: Best Practices</li>
<li>Social Computing: How the Social Web (R)evolution is Changing the Business Landscape</li>
</ul>
<p>I&#8217;ll also be holding a Technology Showcase @ CASCON on WDSC &#038; JWL Tuesday, Wednesday and Thursday from 11:30am till 1:30pm:</p>
<blockquote><p><strong>WDSC JWL 3.0 in Action</strong><br />
This exhibit will demonstrate the rich JSF/JavaScript-based widget library JWL. Currently in the finishing stages of development, JWL will revolutionize the way users interact with applications. Widgets/abilities include full AJAX support, key press bindings, calendars, panel dialogs, panel menus, context assist, converters, and much more.</p></blockquote>
<p>I fallen off my <em>great quest</em> to become an expert at object oriented design patterns &#8212; I seriously have to spend some this weekend.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/10/friday-wrap-up-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to: PHP on the i5 &#8211; The i5 PHP API Toolkit and Calling RPG/CL Programs</title>
		<link>http://www.sematopia.com/2006/09/php-on-the-i5-the-i5-php-api-toolkit-and-calling-rpgcl-programs/</link>
		<comments>http://www.sematopia.com/2006/09/php-on-the-i5-the-i5-php-api-toolkit-and-calling-rpgcl-programs/#comments</comments>
		<pubDate>Mon, 25 Sep 2006 14:53:54 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[i5]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[iSeries]]></category>
		<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=146</guid>
		<description><![CDATA[Before I begin to talk about PHP on the i5, a little history is in order. PHP was created by Rasmus Lerdorf in 1994 to replace a personal set of Perl scripts he used to maintain his website. He officially released version 1.0 in 1995 as a set of CGI binaries written in C, under [...]]]></description>
			<content:encoded><![CDATA[<p>Before I begin to talk about PHP on the i5, a little history is in order.  PHP was created by Rasmus Lerdorf in 1994 to replace a personal set of Perl scripts he used to maintain his website.  He officially released version 1.0 in 1995 as a set of CGI binaries written in C, under the GNU General Public License.  In 1997 two developers at the Israel Institute of Technology, Zeev Suraski and Andi Gutmans, re-wrote the parser releasing PHP 3.0 in June 1998.  Zeev and Andi went on to create Zend Technologies, a company focused on pushing PHP for mission critical business applications.  Rasmus currently works for Yahoo! and is actively involved in the development of PHP.</p>
<p>PHP and RPG have one thing very much in common, when they first came about they were meant to do pretty simple tasks and their names reflected that, Personal Home Page and Report Program Generator.  As the years went on, both languages evolved, with RPG and PHP gaining various built-in functions (BIFs), new programming constructs, XML support, and more.</p>
<p>Zend provides two main components to the i5, the Zend Core and the Zend Platform.  The Zend Core provides, among many things, the essentials needed to run PHP on the i5.  This includes the PHP runtime, the i5 PHP Toolkit, native DB2 support, automatic security updates, a web-based administration console, and more.  The Zend Platform provides addition features to the Core, including run-time code optimization, dynamic content caching, PHP/Java integration, and more.  </p>
<p>In this article I will begin by giving an overview of the Zend Core installation.  Next I will explain what the i5 PHP API Toolkit is and conclude by going through an example of calling an RPG program through PHP.</p>
<p><strong>Installation</strong></p>
<p>The Zend Core makes the installation of PHP on the i5 painless.  To start off, create a SAVF in QGPL under the name ZCOREPROD.  Then download the Zend Core for the i5/OS to your computer and transfer (via FTP) the included SAVF to your i5.  There are numerous open source FTP applications available online, FileZilla is one example.  Remember to do a binary FTP upload.  Once uploaded, perform a RSTLICPGM command to start the installation, i.e.:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>RSTLICPGM LICPGM(1ZCORE5) DEV(*SAVF) SAVF(QGPL/ZCOREPROD)  </pre>
</div>
<p></code></div>
</div>
<p>Once the installation completes, you can test everything went OK by pointing your browser to: http://<IP address of i5>:8000/ZendCore/.  This should take you to the web-based administration console for the Zend Core.  More information on the installation can be found in the Zend Core for the i5/OS manual and i5php.net.  You should now be able to put your scripts in /www/zendcore/htdocs/ and access the files through http://<IP address of i5>:8000/.</p>
<p>Zend also provides the Zend Studio for the i5/OS, a Java based IDE to assist in the development of PHP applications.  IBM and Zend are currently working on the Eclipse PHP IDE project, with version 1.0 set to be released December 2006.  For the purposes of this article, I’ll be using WDSC to work with the i5.</p>
<p><strong>i5 PHP API Toolkit</strong></p>
<p>The i5 PHP API Toolkit (iPAT) is an extension built into the Zend Core, giving PHP developers easy access to their i5, natively though PHP.  The toolkit is broken apart into seven parts; these include Connection Management, CL Commands, Program Calls, Data Retrieval, Native File Access, System Values and Data Areas.  All functions in iPAT begin with ‘i5_’ to ensure no namespace problems come about.  The figure below shows the iPAT organizational layout, along with the associated functions.</p>
<p><a href="http://static.flickr.com/113/252408319_e1aa0c29f4_o.jpg"><img src="http://static.flickr.com/113/252408319_e1aa0c29f4.jpg" alt="i5 PHP API Toolkit" /></a></p>
<p><strong>Calling RPG/CL program from PHP</strong></p>
<p>The lifecycle of a PHP script calling an RPG/CL program has four main steps, these are connect, prepare, execute and close.  A connection first needs to be made to the i5, this is done by using the i5_connect function, and passing in as parameters the i5 IP address, a username and password.  The PHP code below shows this:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>$conn = i5_connect("localhost", "gpapayia", "secret");

if (!$conn) {
    throw_error("i5_connect");
    exit();
}</pre>
</div>
<p></code></div>
</div>
<p>If the connection returns false, then we know something went wrong.  I created a function called throw_error, which takes as input a function name and outputs the error number and associated message from the last executed command.  The PHP code below shows this function:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>function throw_error($func) {
	echo "Error in function: ".$func." --- ";
	echo "Error Number: ".i5_errno()." --- ";
	echo "Error Message: ".i5_errormsg()."&#60;br>";
}</pre>
</div>
<p></code></div>
</div>
<p>Next, the program in question needs to be loaded into memory and prepared to be run.  This is done by executing the i5_program_prepare function and passing in as parameters the name of the i5 program and a description of the inputs expected by the RPG code.  Before I continue to explain this, I’ll introduce the RPG program I plan on using.  For the purposes of this article, the example code I made is simple and serves only as illustration as to what can be done.  The program takes as input a product id, a store location, and a price.  The program updates the price by adding 10.99 and finishes.  The RPG code below shows the stored procedure:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>
     C     *ENTRY        PLIST
     C                   PARM                    prod_id           7
     C                   PARM                    store_loc        10
     C                   PARM                    price             5 2
      /FREE
       price = price + 10.99;
       *INLR = *ON;
      /END-FRE</pre>
</div>
<p></code></div>
</div>
<p>Now back to the PHP coding, once the connection is made to the i5, we need to load the given RPG program into memory and get it ready to be executed.  This is done by using the i5_program_prepare function, and passing in as parameters the name of the RPG program and a description of the inputs expected.  Describing the input variables may seem complicated at first glance, but it’s really is quite intuitive and straight forward.  Each input variable is enclosed in an associative array by specifying the Name of the input, the IO being performed, the variable Type being passed in, and finally the Length.  The PHP code below shows how this would be done.  Notice how the third input, PRICE, has an IO field of I5_INOUT, since I plan on modifying this value from within the RPG code.  There is no real difference between calling an RPG or CL program, just specify the correct program name in i5_program_prepare function and everything else stays the same.  Again, after i5_program_prepare is executed, I check to make sure no error occurred.</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>$description = array(
    array(
    	"Name"=>"PROD_ID",
    	"IO"=>I5_IN,
    	"Type"=>I5_TYPE_CHAR,
    	"Length"=>"7"
    ),
    array(
    	"Name"=>"STORE_LOC",
    	"IO"=>I5_IN,
    	"Type"=>I5_TYPE_CHAR,
    	"Length"=>"10"
    ),
    array(
    	"Name"=>"PRICE",
    	"IO"=>I5_INOUT,
    	"Type"=>I5_TYPE_PACKED,
    	"Length"=>"5.2"
    ),
);

$pgm = i5_program_prepare("QGPL/GEOPGRM", $description);

if (!$pgm) {
    throw_error("i5_program_prepare");
    exit();
}</pre>
</div>
<p></code></div>
</div>
<p>Notice the return value from the i5_program_prepare function is stored in the variable $pgm.  From this point on, any time I want to refer to my RPG program GEOPGRM, I’ll use the variable $pgm.  At this moment, the program is loaded into memory and is ready to be run.  To execute the program, all I have to do is call the i5_program_call function and pass as parameters the prepared program ($pgm), my input parameters and where I want the output parameters to be stored.  The PHP code below shows how this would be done.  As above, the input and output parameters are stored in associative arrays.  Notice in the $paramOut array, I specified for each given input to the RPG program, the variable names I want to refer to after the i5_program_call completes.  For PRICE, I coded in AMOUNT, so after I execute my RPG program, I can get at the PRICE result by using a local PHP variable $AMOUNT.  After I execute the RPG program, I check to see if an error occurred, assuming everything went OK, I output the input/output variables from my RPG program using the PHP echo function.</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>$parameter = array(
    "PROD_ID"=>"xyz101",
    "STORE_LOC"=>"a1001",
    "PRICE"=>0.00
);

$parmOut = array(
    "PROD_ID"=>"PROD_ID",
    "STORE_LOC"=>"STORE_LOC",
    "PRICE"=>"AMOUNT",
);

$ret = i5_program_call($pgm, $parameter, $parmOut);

if (!$ret) {
    throw_error("i5_program_call");
    exit();
}

echo "Product Id: ".$PROD_ID."&#60;br>";
echo "Store Location: ".$STORE_LOC."&#60;br>";
echo "Price: ".$AMOUNT."&#60;br>";</pre>
</div>
<p></code></div>
</div>
<p>At this point, my program executed correctly and I am ready to close my program (unload from memory) and close my connection to the i5.  This is handled through the functions i5_program_close, taking as a parameter the prepared program, and i5_close, taking as a parameter the connection.  The two lines of PHP code to handle this are listed below.</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>i5_program_close($pgm);
i5_close($conn);</pre>
</div>
<p></code></div>
</div>
<p>One reason why PHP has become so popular is that it makes seemingly difficult tasks easy, this in turn frees the programmer to be innovative and spend more time thinking through ideas, rather than coding.  Furthermore, resources to assist PHP developers are available all over the internet, including one of the best manuals for any programming language at <a href="http://www.php.net">php.net</a>.</p>
<p><a href="http://www.sematopia.com/wp-content/uploads/2006/09/php_source.php.txt">PHP Source Listing</a><br />
<a href="http://www.sematopia.com/wp-content/uploads/2006/09/rpg_source.rpgle.txt">RPG Source Listing</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/09/php-on-the-i5-the-i5-php-api-toolkit-and-calling-rpgcl-programs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing MySQL on the i5</title>
		<link>http://www.sematopia.com/2006/08/installing-mysql-on-the-i5/</link>
		<comments>http://www.sematopia.com/2006/08/installing-mysql-on-the-i5/#comments</comments>
		<pubDate>Mon, 28 Aug 2006 18:51:32 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[i5]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[iSeries]]></category>
		<category><![CDATA[PHP/MySQL]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=125</guid>
		<description><![CDATA[There is no doubt, now with Viper (which include native XML support), DB2 is most likely the most powerful database on the market. In many cases one would think if you’re using an i5, you might as well use DB2, not MySQL. Furthermore as of PHP 5 the MySQL extension is by default turned off. [...]]]></description>
			<content:encoded><![CDATA[<p>There is no doubt, now with Viper (which include native XML support), DB2 is most likely the most powerful database on the market. In many cases one would think if you’re using an i5, you might as well use DB2, not MySQL.  Furthermore as of PHP 5 the MySQL extension is by default turned off. I guess by doing this PHP shows no bias towards any database, but like it or not, PHP’s rise to fame was done hand in hand with MySQL.</p>
<p>I’m in a position like this now; I’m playing around with some existing applications, looking to get them working on the i5. My biggest roadblock is thinking of some migration path from MySQL to DB2. Today I came across a tutorial on the Zend Developer Zone on <a href="http://devzone.zend.com/node/view/id/609">installing MySQL on the i5</a>.  MySQL is not supported by IBM, so follow the linked-to tutorial at your own risk.  From the tutorial:</p>
<blockquote><p>MySQL is an open source database that has gained popularity in the web application world and is used in most of the leading/hot PHP (Hypertext Pre Processor) applications. Now that System i is a supported hardware platform for PHP with the availability of Zend Core for i5/OS, we have documented instructions for downloading, installing and running MySQL in the Portable Application Solution Environment (PASE) on the System i. MySQL is not an IBM i5/OS supported environment, use accordingly. </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/08/installing-mysql-on-the-i5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing Applications with a Service Oriented Architecture</title>
		<link>http://www.sematopia.com/2006/08/developing-applications-with-a-service-oriented-architecture/</link>
		<comments>http://www.sematopia.com/2006/08/developing-applications-with-a-service-oriented-architecture/#comments</comments>
		<pubDate>Tue, 15 Aug 2006 19:48:24 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[IBM]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=120</guid>
		<description><![CDATA[Update Aug. 22 06: I just learned about the Open SOA (OSOA) project. It&#8217;s collaboration between the major SOA players to standardize the architecture. The spec is open, plus they have some nice presentations and white papers. From the main page: The Open SOA Collaboration represents an informal alliance of industry leaders that share a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong> Aug. 22 06: I just learned about the Open SOA (OSOA) project.  It&#8217;s collaboration between the major SOA players to standardize the architecture.  The spec is open, plus they have some nice presentations and white papers.  From the main page:</p>
<blockquote><p>The Open SOA Collaboration represents an informal alliance of industry leaders that share a common interest: defining a language-neutral programming model that meets the needs of enterprise developers who are developing software that exploits Service Oriented Architecture characteristics and benefits.</p></blockquote>
<p>Service Oriented Architecture or SOA, it’s an acronym I hear a lot of at IBM these days.  I’m not going to attempt and <a href="http://www-128.ibm.com/developerworks/webservices/newto/">explain SOA</a> in a blog post, but before you start reading, think of it as large pieces of a puzzle easily interconnecting.  Tons of companies have embraced it with IBM, Sun and BEA leading the charge.</p>
<p>I’ll be on course next week here at the Toronto Lab, taking &#8216;Developing Applications with a Service Oriented Architecture&#8217;.  I&#8217;m excited about it; I know the high level details of SOA, but a lot of the finer points, including developing the applications, I lack.</p>
<p>The course covers:</p>
<ul>
<li>SOA Overview</li>
<li>IBM SOA Foundation Products Overview</li>
<li>Design SOA Solutions applying principles and patterns</li>
<li>Develop SOA solutions using IBM SOA Foundation</li>
<li>Case study Overview</li>
<li>WebSphere Business Modeler</li>
<li>WebSphere Process Server and WebSphere ESB Overview</li>
<li>Service Component Architecture (SCA)</li>
<li>WebSphere Integration Developer</li>
<li>Process Choreography and Web Services Business Process</li>
<li>Develop and assemble business rules and human tasks</li>
<li>Supporting Services Overview</li>
<li>Developing Mediation Services</li>
<li>Adapters</li>
<li>Deploying to WebSphere Process Server</li>
<li>Managing SOA</li>
<li>SOA Security</li>
<li>IBM SOA Foundation Governance and Processes</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/08/developing-applications-with-a-service-oriented-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

