Archive

Archive for August, 2010

RPG and Programming › Time Marches On

August 23rd, 2010 Comments off

It has been a long time since my last entry. Much has happened since then. I made two 2100 mile round trips by car back to Michigan, both of them in connection with my mother, who passed away in June at the age of 98. Other personal situations have cropped up too.

At my place of work, I continue attempting to gradually upgrade the system. In addition to my assigned projects and troubleshooting, I am attempting to use more modern techniques; but I find it interesting to look back and see what things I have tried and not tried to do.

One thing that comes to mind is that I am no longer determined to find a way to gradually move code to free-format. If I write new code, it will probably be in RPG-free; but I am no longer attempting to translate fixed format to free. The job is just too daunting; so many of the old programs are just hideously loaded with indicators, and to do a direct conversion, using Linoma’s RPG Toolbox, creates code that would, especially to a neophyte, be even more confusing than its fixed format parent. With proper use of the toolbox we can eliminate left-hand indicators while leaving it in fixed format, and the tool does a very nice job of cleaning things up.

In another context, I am making changes that effectively are advancing beyond RPGIV as presently constituted. Using IBM routines CEESCEN, CEEDAYS, and CEEDATE, I am trying to free the system from its self-imposed reliance upon a century that runs from 1961-2060 for 2-digit years, as well as the ILE RPG range of 1940-2039 for 2-digit years. The boldest move, of course, would be to change all date references in the data files to at least an 8-digit year, if not actual date formats; but in ancient code from multiple systems, that would take a prohibitive amount of time to convert hundreds of files and programs to do this. What I have done instead is create a number of programs based upon the IBM programs above to quickly do date conversions. In doing this, I am implementing a sliding century, such that the two-digit dates will always reference a century that references the current year as the 40th year of the century. Currently, this means that my floating century is 1971-2070. In ten years, it will be 1981-2080.

A typical call would be: To convert Gregorian (MMDDYY) to Julian, we would call:

CALL ‘GTOJ’

PARM ING 6 0

PARM JUL 5 0

You may note that I am using the RPGIII/RPG400 style of calling the program rather than using the one-line form: CALLP(ING:JUL), which involves the creation of appropriate prototypes. The program GTOJ, for instance, does consist of a module DCONV, which sets up and runs the IBM routines, and module GTOJ, which sets up the input and output for DCONV. They are then combined into program GTOJ. All the routines ultimately use DCONV.

However, I could not see the point of the extensive housekeeping involved in making the programs that call GTOJ and the other programs modularized. You, of course, have to create prototypes for each of the programs (about 15 of them, at last count). Of course, I could put them all in one service program, which to my mind creates another layer of unnecessary complexity. The chief justifications for this seem to be performance and the ability to catch inconsistencies between parameters of the called and calling programs. To me, these are not sufficient reasons. In this installation, performance will never be an issue. Trust me. Our new machine (stupid word processor! I can’t put our favorite machine’s name here – OpenOffice keeps trying to capitalize it) runs at least 10 times as fast as the one it replaced. As for parameter checking, any errors last until the first test is run, after which they are corrected.

Another thing that I have cooled on is attempting to get away from MOVE, etc , in existing code. New code that I write contains very few MOVEs, except for enabling date arithmetic. I just don’t see the point in changing existing code to remove MOVE, unless by doing so I can make the code clearer. IBM has not implemented MOVE in freeform, so I don’t see a meaningful amount of existing RPG code being moved to freeform. This means that any RPG neophyte is going to have to learn to deal with both freeform and fixed RPG formats in his maintenance programming.

So time marches on. We continue to watch the progress of IBM with its initiatives regarding RPG, and we wait to see what impact it will have on our day-to-day work. In a small installation like ours, I don’t think we will ever be cutting edge.


Read the original at RPG and Programming.

Mike's IBM i PHP blog and more... › I want to do PHP on IBM i so what do I have to pay for?

August 13th, 2010 Comments off

My last blog highlighted the fact that there are free samples of PHP scripts that come with Zend Server. But I keep fielding the age old questions about what everyone wants for free. The truth is that NOTHING is free. With that said, let’s discuss the licensing arrangement between IBM, Zend and the customer. At a high level, IBM reached out to Zend to provide the PHP runtime, IDE and support for IBM i. This means that IBM does not provide direct technical support to customers for the Zend Stack. But IBM does support Zend in delivering support and solutions like Fast CGI and updates to Apache, DB2, etc.




The ubiquitous Zend Server for IBM i
First, let’s talk about Zend Server for IBM i, the PHP solution for IBM i. Zend Server is a complete PHP runtime with a variety of added features. There is a single distribution of Zend Server for IBM i and it will behave differently depending on which license key is installed. Installation of the Community Edition key will enable the PHP runtime and a couple of bells and whistles. Customers who purchase the full license key will get the additional productivity features like Code Tracing, Job Queue and PHP Application Monitoring. Since the download is the same for either product, come to Zend.com for the files. At this writing there are two option of running PHP 5.2 or 5.3. Also, we have moved to a PTF method for updates. So if you have Zend Server 5.0.1, all you need to do is download the PTF update for 5.0.2 and install using the IBM PTF method. This is a lot easier than doing a rip and replace and it gives the customer more control over the changes. In addition to the free scripts I mentioned in the last blog there are some other pieces like phpMyAdmin, the open source database utility that provides a GUI admin for you MySQL environment.

Zend Server Community Edition for IBM i
I mentioned earlier that NOTHING is free. But, customers of IBM i, do not have to pay for Zend Server Community Edition for IBM i. That is because IBM has paid for this feature for you! To get the Zend PHP runtime, known as Zend Server Community Edition for IBM i customers simply navigate their browsers to Zend.com and download the solution as indicated above and get a free license key at Zend.com. Please keep in mind that this is a perpetual license and will not stop running at the end of the support agreement and that all of the full version features are available for the first 30 days as a trial.

Where’s my free support for Zend Server?
The Community Edition shipped with the IBM i operating system or downloaded from zend.com comes with a first free year of Silver level support. The free year of support corresponds to the first year of usage of a new IBM i operating system purchase, or first installation of Zend Solutions. As Zend Server replaces Zend Core for IBM i, which also came with a first year of Silver level support, the first free year does not restart with an upgrade from Core to Server. This means that if you downloaded Zend Core for IBM i 6 months ago, you are entitled to 6 months of support for Zend Server for IBM i for the same IBM i serial number. If your first year of support for Core has expired, you are still entitled to upgrade to Zend Server Community Edition;you may use the new software unsupported of purchase a support subscription from Zend.

I’m out of support so what do I do?
To buy or not to buy, that is the question! There are two options. Customers who would like to continue some level of support can contact their friendly neighborhood Zend account manager for pricing on Gold or Platinum support. Support and software licenses are sold together on a subscription basis. This means that both support and the advanced features are licensed for a specific period of time, usually 1 to 3 years. There is a charge for this support, but you get what you pay for! Customers who choose not to purchase support can still get questions answered via the forums like WEB400 at Midrange.com or the Zend Forums. If a customer decides to not renew support, the product will continue to run but only with the Community Edition functionality.

So what about that Studio product?
Zend Studio for IBM i is the premier IDE for PHP applications. It is also the ONLY IDE that supports debugging PHP scripts on the IBM i, QED. Zend Studio for IBM i is available at no charge to IBM i customers. Additionally, customers ae entitled to a first year of free basic support from Zend. IBM purchased this product for everyone in the IBM i community so why not take advantage of it?
Zend Studio for IBM i is constrained, however. IBM i customers can only run, deploy and debug PHP scripts on an IBM i. Customers who wish to deploy against a local PC or Linux/Windows server must purchase the full Zend Studio product. There are a variety of license options available but all based upon an annual subscription model.
Zend Studio features are documented at Zend.com but at a high level there is support for PHP, JavaScript, HTML, CSS, Object Introspection, and much more.

I got an email saying that my support is running out!
Most likely you did. Just before the one year anniversary of your support expiration Zend will send out notices to customers who have downloaded the solutions and registered their servers. This is to provide you with planning options so that your support does not lapse. Both Zend Server Community Edition and Zend Studio are perpetual license so they will continue to run. But updates may not be as frequent and there is no support outside of the defined support agreements.

I hope this clarifies a few things. Ultimately, any questions can be addressed by an account manager. If you are not sure who your account manager is, please let me know or contact our sales folks at Zend.com.


Read the original at Mike's IBM i PHP blog and more....

Categories: Blogs Tags: