Collaboration at COMMON

The 2015 COMMON annual meeting and expo, now in its first day, is helping speakers and attendees create innovation through IBM i integration: open source, closed source, IBM and vendor solutions. For example, of my six presentations during this conference, two are collaborations:

The Art of Performance Diagnostics, with IBM’s Dawn May, allows us to show, among other topics, how IBM i’s integrated performance tools complement green-screen tools and third-party tools (in this case, Zend Server) to pinpoint and solve performance issues (here, PHP-and DB2-based applications).

PHP Tricks for RPG Developers, a talk jointly created by RPG and SQL expert Birgitta Hauser and me, combines RPG, PHP, and DB2, allowing RPG to achieve graphical (charts and graphs, PDF and Excel files) and internet (json-based web services, flexible email) functionality using native functions.

Conferences such as COMMON serve a need that’s difficult to replicate back at the office—brainstorming and sharing possibilities among interdisciplinary peers, or sitting side-by-side with like-minded colleagues who work for different employers, to try something new. This week, for example, some of us plan to share knowledge on compiling binaries in PASE and to further the potential of open source on IBM i. I’m looking forward to presenting my talks (both joint and solo) and helping to realize new ideas with forward-looking colleagues during the conference.

Birgitta Hauser and Alan Seiden collaborate on their talk at COMMON 2015

Birgitta Hauser and Alan Seiden collaborate on their talk at COMMON 2015

Overcome 8-character user profile limit in SSH for IBM i

By default, user profiles longer than eight (8) characters cannot connect to IBM i via Secure Shell (SSH). This limitation affects tools such as Zend Studio, which will show a message similar to “Failed to connect sshd on “<some ip address>.” Beginning with IBM i release 6.1, however, IBM provided a means of removing this limitation, so that user profiles longer than 8 characters could connect. Releases 6.1 and 7.1 require a PTF and a configuration change; release 7.2 and higher require only the configuration change.

For details, see  Zend Support specialist Rod Flohr’s article about how to remove the 8-character limit on user profiles when connecting via SSH.

Free webinars sponsored by COMMON Europe (open to all)

Starting January 27, 2015, I’ll be giving three free Tuesday webinars:

  • January 27: Strategic Modernization with PHP
  • February 17: Bring RPG/COBOL business logic to the web with the PHP Toolkit
  • March 10: Speedy PHP on IBM i

All three one-hour webinars will be held at 14:00 Central European Time (CET). That’s 8 AM Eastern Standard Time (EST). The registration page includes a time zone converter.

Details and to register: http://www.data3.se/?p=5287

Thanks to Torbjörn Appehl of Data3 (COMMON Sweden) for organizing these.

January newsletter

I’ve relaunched my PHP and IBM i newsletter. Here is the January 2015 edition, out today.

To subscribe and receive this free newsletter each month, go here: alanseiden.com/tips.

Comments welcome. Happy 2015–

Alan

Learn to combine RPG+PHP at Toronto user group, Jan. 21, 2015

I’ve recorded a special message about my upcoming presentations at the Toronto Users Group for Power Systems evening meeting on January 21, 2015:

In the video, I discuss the two sessions I’ll be presenting:

  • Bring RPG/COBOL business logic to the web with the PHP Toolkit
  • PHP Tricks for RPG Developers

Hope you can make it to the Toronto meeting, Jan. 21, 2015, Markham, Ontario. Details: http://tug.ca

Free PHP still exists on IBM i (Zend Server Basic Edition)

I’ve been hearing from people confused about Zend Server editions on IBM i. Yes,  Community Edition was removed with Zend Server 7/8, but Zend replaced that with the no-charge “Basic” edition. The Basic edition exists only on IBM i. It requires registration but at no cost. Zend Server for IBM i can be downloaded here.

While I often recommend the Professional or Enterprise editions of Zend Server for the value-added tools (Z-Ray being the newest and most exciting, but also Zend Job Queue, Zend Monitor, and more) and for Zend’s professional support, rest assured that free PHP still exists, with the Basic edition.

For more information, here is the current list of Zend Server editions for IBM i.

Zend Framework 2 performance optimization: it works

Zend Framework 2 (ZF2) provides optimization techniques that are often overlooked by published performance tests. One excellent source for such techniques is a presentation by Gary Hockin. I was thrilled when my client and friend King Harrison IV of K3S began testing the effect of these techniques on his ZF2 application running on IBM i.

King’s initial tests produced a 600ms reduction in load time, obtaining respectable performance for his database-heavy application. He plans to update his blog post with further speed improvements as he implements them.

Read King Harrison IV’s blog post about ZF2 performance improvements.

Save your fingers when using PHP-CLI

In Batch PHP I showed how to call PHP from a command line. For example, with Zend Server 6 or 7 on IBM i, one would launch a PASE command line using the command CALL QP2TERM, or launch QShell using QSH, then type a command such as this:

/usr/local/zendsvr6/bin/php-cli myscript.php

For those of us who use PHP-CLI often, the above command can be a finger-buster. Let’s shorten the path by creating a symbolic link:

cd /usr/bin
ln -s /usr/local/zendsvr6/bin/php-cli phpc

I created the symbolic link in /usr/bin, a directory that is likely to be in any user’s path.

Now try the shortened command:

phpc myscript.php

To test the shortcut without a PHP script, use the -v switch, which requests version information (‘v’ for version) about your PHP installation.

phpc -v

The above command will return version information that starts out something like this:

PHP 5.3.6 (cli) (built: Apr  7 2011 09:37:14)                                
Copyright (c) 1997-2011 The PHP Group                                        
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies                
    with Zend Extension Manager v5.1, Copyright (c) 2003-2010, by Zend Techno
logies                                                                       
    - with Zend Data Cache v4.0, Copyright (c) 2004-2010, by Zend Technologie
s [loaded] [licensed] [disabled]                                             
    - with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technolog
ies [loaded] [licensed] [enabled]                                            
    - with Zend Job Queue v4.0, Copyright (c) 2004-2010, by Zend Technologies
 [loaded] [not licensed] [disabled]

By creating a symbolic link to the PHP-CLI binary, practitioners of PHP can speed their work while saving their fingers.

For more about symbolic links, see my article Link up with QShell.

Zendcon 2014 promo video for IBM i users

About Zendcon:

Find the Technology Refresh (TR) level of an IBM i

Update: I have since learned that the “PTF” IBM i Service (DB2 and SQL) provides one’s TR level more cleanly than with other approaches. I read of the improved approach in an article by Tim Rowe: https://systemideveloper.com/blogs/db2-for-i-services-use-sql-instead-of-system-apis/ by way of Club Seiden member PHP Dave.

IBM i services comprise a collection of DB2 and SQL objects that provide a wealth of system information. The GROUP_PTF_INFO view, for example, will display an IBM i’s Technology Refresh (TR) level to the user who runs this SQL:

SELECT CURRENT SERVER CONCAT ' is running ' CONCAT PTF_GROUP_TARGET_RELEASE 
CONCAT ' with TR level: ' CONCAT PTF_GROUP_LEVEL AS TR_LEVEL 
FROM QSYS2.GROUP_PTF_INFO WHERE PTF_GROUP_DESCRIPTION = 'TECHNOLOGY REFRESH' 
AND PTF_GROUP_STATUS = 'INSTALLED' ORDER BY PTF_GROUP_TARGET_RELEASE DESC 
FETCH FIRST 1 ROWS ONLY

When run on my server, the result was a single column, TR_LEVEL, with the value:

SEIDENI is running V7R2M0 with TR level: 3

Time for me to upgrade, yes?

Here was the original post with older techniques:

I recently needed to know if a client’s IBM i 7.1 system had Technology Refresh 4 (TR4). If it did, I could use the relatively new INSERT with remote SUBSELECT technique, which allows a single SQL statement to copy DB2 data from one partition to another. Such are the benefits of keeping current with Technology Refreshes.

After reading an article on TRs by Steve Will, I decided to document how to determine which TRs are installed on an IBM i system.

TRs, which were introduced with IBM i 7.1, are packaged as Program Temporary Fixes (PTFs). They can be found with the DSPPTF command.

First, determine the product number of the licensed internal code of  your system. For 7.1, the product number is 5770999.

Then use the DSPPTF command followed by this product number. For example:

DSPPTF 5770999

When run on my test system, this command produced a list of PTFs that included MF99007, MF99006, MF99005, MF99004, MF99003, MF99002, and MF99001.

Because Technology Refresh PTF numbers follow the format MF99nnn, where nnn is the TR number (bolded above), I knew that TR7, TR6, TR5, TR4, TR3, TR2, and TR1 were available. I was pleased to learn I could use TR4’s enhancements to DB2.