Archive for the 'iSeries' Category


Talks @ TEC 2007

Monday, April 16th, 2007

I’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’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

PHP For RPG Programmers

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.

Web 2.0 for System i

Wikis, blogs, AJAX, The Long Tail… 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’ll look at examples of Web 2.0 related technologies and concepts to help define what Web 2.0 is all about. Then we’ll briefly explore how Web 2.0 can be produced and consumed with System i. Co-Presenter: Abe Batthish

WDSC Development Team blog

Wednesday, March 14th, 2007

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 blog, and hope to facilitate a lively discussion amongst members of the community.

Insight into how System i budget spent

Friday, November 3rd, 2006

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 the budget and how the money is spent.

Elaine Lennox is happy and excited to have a job that comes with a uniform. It’s red and white with concentric circles and a big blue bull’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’t hiding from anyone. She’s used to the rock throwers, the outspoken critics with pointy sticks, and the heat about below average marketing of the platform.

Friday wrap-up #3

Saturday, October 28th, 2006

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’ve gotten more intimate (?) with Dojo and its inner workings. I wrote about Dojo a couple months ago, and I’m still really impressed with everything going on there. A lot of big name sites are built off this toolkit, including Meebo.

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 article sums things up:

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.

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’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).

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.

I was at a Halloween fund raiser for Diabetes last night, it was a good time for a good cause. I’m amazed that no matter what type of social event I may be at, there’s always someone thats directly involved with the System i in some way.

In other news, RedHat got murdered this week in the markets. Cisco announced they would be creating a fork the RedHat’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’s dominance in the Enterprise Linux market.

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’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.

How to: PHP on the i5 – The i5 PHP API Toolkit and Calling RPG/CL Programs

Monday, September 25th, 2006

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.

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.

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.

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.

Installation

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.:

Code:
RSTLICPGM LICPGM(1ZCORE5) DEV(*SAVF) SAVF(QGPL/ZCOREPROD)  

Once the installation completes, you can test everything went OK by pointing your browser to: http://: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://:8000/.

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.

i5 PHP API Toolkit

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.

i5 PHP API Toolkit

Calling RPG/CL program from PHP

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:

Code:
$conn = i5_connect("localhost", "gpapayia", "secret");

if (!$conn) {
    throw_error("i5_connect");
    exit();
}

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:

Code:
function throw_error($func) {
	echo "Error in function: ".$func." --- ";
	echo "Error Number: ".i5_errno()." --- ";
	echo "Error Message: ".i5_errormsg()."<br>";
}

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:

Code:
     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

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.

Code:
$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();
}

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.

Code:
$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."<br>";
echo "Store Location: ".$STORE_LOC."<br>";
echo "Price: ".$AMOUNT."<br>";

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.

Code:
i5_program_close($pgm);
i5_close($conn);

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 php.net.

PHP Source Listing
RPG Source Listing

Installing MySQL on the i5

Monday, August 28th, 2006

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.

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 installing MySQL on the i5. MySQL is not supported by IBM, so follow the linked-to tutorial at your own risk. From the tutorial:

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.

PHP for i5 GA

Tuesday, August 1st, 2006

The first GA for PHP on the i5/OS happened yesterday. Unlike the early release I installed here at the lab, this one will have an API to connect with existing application on the iSeries:

This version includes Apache 2 and PHP 5.1.4 support as well as a set of stable extensions for the IBM i5/OS platform.
The new Web Server and PHP runs on the i5/OS under PASE.
The version supports HTTP access through the existing i5/OS ILE Apache Web Server and can be installed on the i5/OS platform.
This version supports the IBM i5/OS DB400 through the ibm_db2 extension.

From the press release:

System i customers have shown great interest in PHP during the beta test phase, with thousands of System i customers and solutions providers downloading the beta releases. Using Zend Core for i5/OS and Zend Studio Professional for i5/OS, System i customers and solutions providers can develop innovative, new Web applications rapidly and cost-effectively or create Web front ends for existing applications written in RPG, C, C++ or Java(TM). Zend Core for i5/OS will include a toolkit that enables PHP applications to easily access the integrated DB2 database and other resources in i5/OS.

System i revenues slide or failure to meet demand?

Friday, July 21st, 2006

Search400.com had an article yesterday titled System i revenues slide:

Revenues for the System i dipped 7% in the second quarter, marking the third consecutive drop the server platform has seen.

Sales plunged 22% in the first quarter and 12% in the fourth quarter last year. The three consecutive quarterly drops follow three consecutive quarterly surges, when IBM pushed the iSeries line with upgrades and aggressive marketing.

During that time, IBM pushed the platform hard, running ads in TV and print media. It also increased support for its independent software vendors (ISVs) and developed its internal software applications.

A webcast by Mr. Loughridge (President & CFO) this past Tuesday (July 18th) expained. The situation is not as bad as the article came across.

We were unable to ship to meet all of our customer demand… our unusually high unfulfilled orders due to end to end supply chain problems… if we had been able to ship based on our normal… we would have been about even.

You can here the webcast here.

System i PHP Due by Month’s End

Friday, July 14th, 2006

Interesting article, the first full release of PHP is due at month end. The driver I installed here at the Toronto Lab doesn’t have RPG support yet, this one will.

Zend Software is gearing up to deliver its long-awaited PHP software for the System i at the end of the month. The widely used scripting language for building dynamic, server-based Web apps promises to usher the System i into the world of modern Web development.

According to Zend, PHP has several advantages over other Web-development technologies, not the least of which, for some shops, is that it reduces dependency on the processor-intensive, Java-based WebSphere. Open-source PHP is lightweight, high performing, and offers a short learning curve.

Zend Core for i5/OS, available free from IBM, supports PHP scripts to access data in the System i database and RPG and Cobol applications.

Here is the link

Trends and the iSeries

Thursday, July 6th, 2006

A little while ago a new Lab product came out called Google Trends. The service attempts to give some insight into what regions, cities, people, etc. are searching for a given term. With a push from Ed Brills post, I was on my way.

I did a comparison of i5 (blue), iSeries (red) and System i (orange). Of the three, the most distinct is iSeries, because no one will really search the term iSeries without meaning to search for the IBM product. On the other hand, people in California might search I5 for the interstate highway.

Nevertheless, some of the results are pretty interesting:

cities.jpg

languages.jpg

regions.jpg

Gartner report on i5/OS

Sunday, June 18th, 2006

Back in May Gartner published a report on the i5 with the lackluster title “IBM i5/OS Operating System”. I’m sure upper management put pressure on Mary (Mary Hubley, the writer) to keep the article as unbiased as possible. Initially the article was only available by Gartner for $95, but now can be downloaded for free from IBM.

The article, blunt at times, is a great introduction to the i5/OS, especially for those who have had little exposure to the system. The report starts off my saying:

Even though the System i5 experienced something of a revival in 2005, Gartner has noted an ongoing decline in market share since it peaked in 2000, and recent Gartner surveys suggest this trend will continue. That is not to say that the System i5 is in its exodus; on the contrary, it is still a viable platform. IBM has done a good job to ensure this, with renewed investment in hardware and software, and it has been giving independent software vendors (ISVs) incentives to modernize their software. Customers are responding with new purchases. However, many customers are still seeking alternatives as they transfer some unessential work from aging AS/400 platforms to less expensive Windows or Linux servers. Though it has seen some improvement, IBM must work to keep customers interested.

But then goes on to say:

…IBM has renewed its interest in the System i5 … IBM recently devoted a dedicated sales team to concentrate on new System i5 customers, while another team continues to focus on selling upgrades to the installed base. IBM also started an “Initiative for Innovation Program” to encourage ISVs to modernize their applications and to deliver more applications. As a result, IBM says there are over 600 new i5/OS applications and 220 tools being developed. In addition, IBM has included essential advancements to modernize its i5/OS systems, including Linux and Windows support, clustering, LPARs and virtualization technologies. Further, IBM introduced a multimillion-dollar advertisement campaign, called “Why ‘i’? It’s Simple.” This campaign’s key message is simplicity – that the System i5 reduces complexity in the IT environment, and that it is easier for IT staff to manage a system that has had its kinks worked out by the vendor.

The article makes no mention of the recent early release of PHP (Zend Core) for the i5. Personally speaking, PHP on the i5 is ground breaking: The stability, security, strength of the i5 combined with the rapid, open development of PHP – it’s a match made in heaven. The report highlights SMBs as IBM target, but fails to realize the emerging technologies which the i5 has embraced.

The reason for using an i5 is simple; customers have seen this for years:

Through its long life span, the OS/400 operating system – now i5/OS – along with its System i5 computer line, has outlasted nearly all of its proprietary system competitors. System i5 servers have the reputation of being painless to manage and operate, cost of ownership is generally low, and enduser organizations can devote minimal IT administrators to support them. Users can often move their applications forward through multiple generations of technology change. It is just this simplicity that SMBs, IBM’s target market, are saying they want. IBM is accommodating their requests with its still simple-to-manage, yet up-to-date, line of System i5 servers.

The i5/OS, coupled with its System i5 hardware, is considered a highly reliable, secure, and high-performing product, which the respondents in the U.K. survey indicated were important. This bodes well for the System i5 and perhaps will attract some IT organizations looking to consolidate underperforming Windows, Unix, and Linux servers.

Link to report

RPG IV V5 course done

Thursday, June 15th, 2006

I was on course the past 4 days at 3600 Steels (IBM Canada head office) learning the basics of RPG IV V5. RPG is one of the few languages still used today that was initially designed to be used with punch cards. Over the years, IBM has continued to improve the language, starting to move away from the column oriented structure and giving the programmer powerful features including pointers, subprocedures etc.

The name should be changed though; it stands for Report Program Generator. Back in the day that would make sense, but today RPG is used for much more. I won’t be using RPG directly, but learning the native iSeries (i5) programming language is important. Follow these links to learn more about RPG and IBM Training.