Archive for the ‘Uncategorized’ Category

Moving to IBM i 7.2

Been meaning to do this for at least 6 months and finally bit the bullet and MOVED!  Naturally, the website has been down for days as I worked through several wrinkles.  On the IBM i OS side, I failed to pull my keys ahead of time.  Actually I DID download and install the keys. I also downloaded the updated OS and licensed programs and the latest CUME BUT the one thing I failed to do was to choose to “upgrade” on the IBM ESS site so although I had everything, the only keys it originally pulled was for base OS.  After I choose to “upgrade” on the ESS site, I suddenly had a boatload of keys which installed just fine.

When you upgrade once every few years there are always things you forget about, so it took a few IPL’s to get the everything running again.  So now I have a 7.2 and a 7.1 partition on my JS12 blade.  All is right with the world.

Well, ALMOST!  The web sites I had were mostly on their feet with a couple of exceptions.  My PHP sites were falling over and examining the logs revealed an interesting error:

exec(): 0509-036 Cannot load program /usr/local/ZendSvr/bin/php-cgi.bin because of the following errors:
rtld: 0712-001 Symbol EVP_md2 was referenced
from module php-cgi.bin(), but a runtime definition
of the symbol was not found.

Hmmm…not sure what was up with that.  I knew my Zendsvr install was relatively ancient (5.xx) so I decided to contact Mike Pavlak at Zend and see what I should do.   UPGRADE!   Of course that is what he said (duh!) so I downloaded the latest Zend Server version and installed it.  The beautiful new server access pages worked great!  But, my WordPress sites, and any other PHP based pages were still falling over.  So, back to Mike!  With a little bit of looking over the shoulder, Mike noticed that perhaps I was still back in the dark ages, referencing the wrong server (might it be the old Zend Core?) and he pointed me to a very helpful page that triggered enough neurons to get me thinking along the right lines….the problem might have been in the directives so he pointed me here.  Turns out it was the fast cgi directives….kind of.  Here is the deal.  I DID have the two things recommended by the page set up correctly:

LoadModule zend_enabler_module /QSYS.LIB/QHTTPSVR.LIB/QZFAST.SRVPGM

and

AddHandler fastcgi-script .php

So, I was a bit stumped….until I read on and saw the recommendation for the contents of the fastcgi.conf file.  My clue was at the very beginning of the file:

CommandLine=”/usr/local/zendsvr6/bin/php-cgi.bin”

Scroll back up and take a look at the path mentioned in the error I encountered:

Cannot load program /usr/local/ZendSvr/bin/php-cgi.bin

AHA! The fastcgi.conf is where the Apache directive finds how to execute the php page!   So, all I had to do was change any reference from /ZendSvr/ to /zendsvr6 in any of the fastcgi.conf files that I have.  Voila!  All is well!  All happily running under Zend Server 8.0 now.  Thanks Mike!

Next I had to update WordPress.  The automatic update has never really worked correctly so I did a manual update and made the mistake of using the readme.html in the WordPress bundle file to guide me.  Don’t use that for upgrading!  Use the instructions found here. Once I took the proper approach, WordPress was up and running in no time.

So, now it is time to play, play, play with all that IBM i has new in 7.2!

Comments Off on Moving to IBM i 7.2

Handouts for the Common Spring Conference 2014

They will eventually make it to the Common website but here are the quick links to get them now:
Developing defensible web applications on IBM i

Open Source Tools and Applications for the IBM i

Developing Mobile Applications for i Using Open Source Tools

Open Source Report Writing Tools for IBM i

Ruby on Rails on IBM i

 

Comments Off on Handouts for the Common Spring Conference 2014

Common Spring Conference – Whats App?

Can’t believe that the spring conference has rolled around again.  Seems like we just finished fall and I haven’t blogged, Tweeted or been “Social” at all in the interim.  I have been BUSY and I plan to get back to blogging (at least) as soon as I can get through the conference.

First off,  I have been deep in midst of fleshing out my Mobile App Development workshop for THIS Saturday (yikes).   Trying to pull together 7 hours of content that is both useful and fun has been a bigger challenge than I expected but I am putting the finishing touches on all of it now primarily so I can get on with updating the other presentations I am giving at the conference.

One of the fruits of that effort is the update to the Common Schedule Organizer.  You can read about the functionality in earlier posts here.  I hoped to add some new function to this revision but things have just been too busy for me.  So I have the new schedules and maps loaded and they are ready to go!  You will find the new web app here. You’ll find the Android APK (Android 2.1 compatible) here. You will want to access that link from your Android device and you’ll be alerted to the fact that you need to change settings to allow an “unknown” app to install.

Once you have the app installed on your device, you may notice that the prompt dialog that asks you for email address for your Common Personal Grid will only appear briefly and then will disappear.  I am not sure where this bug resides but the workaround is to the “My Schedule” page and click on the “Change Grid Email Address” button.  This time the prompt should stay open for you so you can type in the email address and retrieve your schedule.

Based on what I have seen so far this conference will be very well attended and have some pretty exciting sessions. Enjoy the CSO app!  See you there!

Comments Off on Common Spring Conference – Whats App?

Common Schedule Organizer – Fall Edition 2013

Yep, it is that time again!  Common Fall conference and I had to deal with a couple of API changes and I implemented a few of the suggestions from the Spring Conference so, as usual, I am late to the party.

You will find the web application version here:

You can download the Android APK here:

Same drill as before:

If this is the first time you have used the app, or you have updated, you will be prompted for your email address that you use to access the Personal Grid on the Common website.  Your personal grid information will be pulled into the app but remember it is a one way street: As you add items to your schedule in the CSO they will NOT update your personal grid info (still working on the best way to handle it both ways).

Once you have entered that info and are on the main app screen, click on the “Load Schedule” button.  It will turn yellow and after 30 seconds or so you will see a “Loading” message appear and flash on the screen.  It took me about 2 minutes to download the initial schedule.  At that point the message should change to “Ready” and you are ready to go.  If you have personal grid items, go ahead and visit your schedule to make sure they downloaded.  From then on you can update the schedules, both the master schedule and the personal grid info and it will update the app with the latest and greatest.

I have added conference maps and I have added a list of local restaurants.  Perhaps I can add a “Yelp” type feature that will late you folks rate them.

If you have something other than an Android device, you can use the web application version of the app.  It will still save your stuff to the device you use so it is still plenty handy it just won’t be “native”.

If you have a question or a suggestion you can always email me (you know my name) at the company domain (valadd dot com).  I’ll try to get back to you and patch things as necessary.

Enjoy! See you at the conference!

Comments Off on Common Schedule Organizer – Fall Edition 2013

The Austin Challenge!

Bummer if you are not here in Austin for the Common Annual Conference.  Perhaps you have heard of ‘Austin City Limits’ a program that showcases Austin’s music and night life (its all true!) Or maybe you have heard of that intimate gathering of music and tech aficionados  called South by Southwest (SXSW)?  Anyway, Austin is buzzin with IBM i excitement and all it takes for me to get a flare up of creative energy is a fun environment and a little free time.  So when I saw a post by Eric Lehti on Midrange-L that said of the iPhone application: “It does not list the Austin Barbeque restaurants in this release though. Big fail!” I thought “Why not add that to a REAL application like the Common Scheduler Organizer I developed for Android?”  Not hobbled by IOS I went ahead and knocked it out for Eric.  Sorry Eric, I haven’t compiled and deployed it for iPhone yet so you’ll have to use the web application version found here.  If the rest of you happen to be fortunate enough to be running Android, go ahead and download the APK found here (use ‘save as’ or navigate to the link with your Android device).

Downloading the new APK may wipe any additions to your personal grid that you have already added (working on how to do that smoothly).  You might also have to hit F5 refresh on the web application version to get the list of Austin restaurants.   The list isn’t JUST barbeque places but I was in a board meeting all yesterday, out with friends last night, running in the Common Cares 5k this morning so I have only had a few minutes to throw this together.

Enjoy!

Comments Off on The Austin Challenge!

Common Schedule Organizer 2013

Just in the nick of time, the Common Schedule Organizer, a free mobile app for Android, is now available!  There isn’t much new functionality (always willing to take suggestions) but it has been updated with the latest Phonegap libraries and the latest jQuery mobile.  It is still written for Android 2.1 devices and up so even that ancient Samsung Galaxy Spica I own can run the app.  It is still lean and mean and can be downloaded here.

If this is the first time you have used the app, you will be prompted for your email address that you use to access the Personal Grid on the Common website.  Your personal grid information will be pulled into the app but remember it is a one way street: As you add items to your schedule in the CSO they will NOT update your personal grid info (still working on the best way to handle it both ways).

Once you have entered that info and are on the main app screen, click on the “Load Schedule” button.  It will turn yellow and after 30 seconds or so you will see a “Loading” message appear and flash on the screen.  It took me about 2 minutes to download the initial schedule.  At that point the message should change to “Ready” and you are ready to go.  If you have personal grid items, go ahead and visit your schedule to make sure they downloaded.  From then on you can update the schedules, both the master schedule and the personal grid info and it will update the app with the latest and greatest.

If you have something other than an Android device, you can use the web application version of the app.  It will still save your stuff to the device you use so it is still plenty handy it just won’t be “native”.  You will find the web application available here.

If you have a question or a suggestion you can always email me (you know my name) at the company domain (valadd dot com).  I’ll try to get back to you and patch things as necessary.

See you at the conference!  Enjoy!

Comments Off on Common Schedule Organizer 2013

Rational comes through

Or maybe it was just IBM….but in any case I would be remiss if I didn’t post that after multiple emails and phone calls my friends at IBM/Rational found a way to sort through the licensing, notices and documentation and get the SWMA renewals sorted out!  I have put the SWMA dates into my calendar so that I won’t miss the boat the next time around and I can always hope that next year everything will go smoothly…well, I can always hope.

Thanks Rational team!

Comments Off on Rational comes through

More (ir)-Rationality

I love Rational tools but as I mentioned to my IBM sales representative “I am beginning to suspect that the Rational Marketing team has never left the 60’s and is still “tripping” when they decide to put their pricing together.  That or they took their sales class from PT Barnum (“There’s a sucker born every minute…”). ”  The source of the pain here is that as a developer enrolled in IBM’s wonderful (and it IS wonderful) developer discount program, I had two primary complaints:

1) You receive no notification of expiring Software Maintenance Agreements (SWMA)

2) Trying to sort out what the final costs will be based on the various discounts and product ID’s is nothing short of alchemy….

#1, I am happy to say, has been “fixed”.  I did receive notification that my SWMA was expiring. But every year is an adventure and this year was no exception! The IBM OS and licensed programs are very simple, I never have a problem with them.  But when it comes to the Rational products, you can never really know how the pricing will come out.  Fortunately, I only have ONE Rational product – RDP (it has been through many naming conventions: WDSc, WDSCi, RDi, RDP and if I can believe what my IBM sales rep says, it is now RDG) but the constant name game leads to confusion every year as to *what* exactly, needs software support.  This year I was finally able to narrow it down to my two licenses of RDG.  “Send me the quote” I said!

What I received first surprised and then confused me.  The quote I *thought* I would receive was $548 for *both* my licenses. You have to remember that this is a developer *discount* program and everything on the i IS heavily discounted.  Everything BUT the Rational tools.  The cost of the OS (nada).  The cost of the supporting OS products, nada!  Cost of the Rational tools? 131% of list!  Yeah, you read that correctly.  For a developer ‘discount’ program the actual tools cost you MORE than if you purchased them retail.  Tis the “Smarter Planet” at work at IBM!  I am just hoping that Microsoft (which *discounts* it’s tools) doesn’t catch wind of this cash cow approachfor IBM…..

My SWMA on *each* copy of RDG is $548.  My cost if I buy a license with 1 year of support from IBM “retail”: $416.00  You would *think* that a developer discount would produce a *lower* cost for the developer.  Gee, I wonder why RPG developers *don’t* move to use Rational tooling?  Hmmm, could it be the (ir)-Rational pricing?

Just once I would love to be surprised in a happy way by Rational pricing.  Developers should get a discount when there is a ‘developer discount’ offering don’t you think?  Apparently the Rational division thinks not…..

Comments Off on More (ir)-Rationality

Mobile application development and IBM i (Part three) – To the web!

So a lengthy delay in getting to the “webby” part of this post due to the holiday distractions.  This new post should, however, get you going again and get the creative juices going.

When last we met I walked through the “green screen” version of the “timeclock” app.  This would actually make a fairly poor mobile application unless you have a 5250 client for your mobile phone (such things do exists!).  But when it comes to mobile applications, either a native application or a web application is the way to go so we’ll start down the initial path of a web application which will eventually end up as a mobile native application.

We are still keeping it simple so you can get the basics under your belt.  So, a quick review.  The basic “cycle” of our RPG application (which doesn’t use ‘the cycle’) is this:

  1. When we enter the program we set some ‘global’ variables that we will use in the program.  Some of them are just initial variables like the ‘punchdate’, ‘punchtime’, the day of the week and initial indicators.  We also call a procedure to get the last punch of the employee (which is always employee ’55’).
  2. We then enter a loop that set’s a couple of indicators and then displays the 5250 screen (EXFMT) and then the program waits for a key event to continue processing. The code below the EXFMT is executed when the button for “Punch IN”, ‘Punch OUT” or exit is clicked (or alternatively when F6,F7 0r F3 are pressed).
  3. The procedure “Punch” does the heavily lifting.  All of this should be easily (!) discernible from the code if I have done my programming job right.

Again the reason for the sub procedures, which we could have coded more procedurally, is so that we could reuse them when we convert the 5250 program into a CGI web program with CGIDEV2. In our 5250 program we have 25 lines of operable code.  In our CGIDEV2 equivalent web program we have 26 lines, so our coding remains pretty much the same. The big difference? Note the missing DOU loop?  How can this work?  In our 5250 app the program loads and remains running until the exit key is pressed.  In our CGIDEV2 program, the web server calls and executes our RPG program but the program does not continue to run.  It is simply called again if the page is requested again. Web programming is essentially stateless.  It doesn’t retain a “context” between calls.  A user in China could access the page and another user in the states could access the page and the program is really clueless about the two locations.  As HTTP server technologies grew and pages became interactive then state was built into the process using a host of approaches, most commonly using and storing session information to track the users connection to the server.  5250 doesn’t suffer from this design so preserving state isn’t an issue in a 5250 program but it is an issue in Web development and although we won’t jump into the approaches it explains the unusual design of our CGI program.  It runs, it’s done.

So looking at the differences in the code. Let’s start with the “screen design” which in this case is bare bones HTML (well *almost* bare bones).  Lets start with the most important components (look at BASIC.HTML in source file HOSTHTML).  Take time to check out the w3schools.com website to understand the basic HTML directives if you are unfamiliar with them.  I don’t plan to dwell deeply on the HTML:

  • /$thepage – this directive gives a name to the section the CGIDEV2 will read and write to the HTTP server.  This is PURELY a CGIDEV2 directive.  PHP, the FreeMarker and Velocity frameworks and a host of other templating frameworks use different conventions for their directives but in this case CGIDEV2 uses this to denote the start of a ‘section’.
  • /%lastPunch%/, /%punchDate%/,/%doweek%/,/%punchTime%/  – These are all ‘placeholders’ in the HTML that will be replaced with data when the form is processed by the RPG CGIDEV2 program. Think of them as the field definitions in your DSPF.  The replacement is handled very automagically for you in 5250 programming.  In CGIDEV2 you need to be a bit more explicit.
  • The rest of the form has standard HTML.  You’ll notice a “hidden” field in the form called PB2.  We’ll use that to store which button was pushed, much like we did in the 5250 program (for comparison sake). We are writing out a table in the HTML using the <table> tags along with <tr> (table row) and <td> (table division – think column).  We draw a couple of buttons with the <input type=button> tags and we call some javascript (within the <script> tags near the top of the HTML) to process the button click events.

Examining the RPG (CGIDEV2) code (CGI_PUNCH.SQLRPGLE).  We have added some infrastructure for CGIDEV2 (all of the copy statements) and you’ll need all of them particularly don’t forget the prolog3 copybook (don’t ask me why I mention it….).  Outside the inclusion of some additional variables and copybooks, it looks pretty similar to our original.  With the following changes:

  • PunchBtn = %trim(zhbgetvar(‘PB2’)); – Remember that hidden text field? It is updated by the javascript on our HTML form but then read here in the program using the CGIDEV2 procedure zhbgetvar which basically pulls it from the HTML that was read in.
  • gethtml(‘HOSTSHTML’:’MOBILEREM’:’BASIC’); – Grabs the HTML for our page so we can write new data to it before it is sent back to the browser.
  • getLastPunch(employee); We run this procedure here because the “punch” procedures above could have just recorded a punch so we want to retrieve those values before we write them back to the page.
  • updhtmlvar(‘lastPunch’:lastPunch); All of the updhtmlvar calls write the data to the retrieved HTML page into the replacement fields we have identified.  The /%lastPunch%/ directive in the HTML will be replaced with the data in the lastPunch variable found in our RPG.  There is no need to name these the same.  The value on the left (‘lastPunch’) is replaced by the contents on the right (host variable :lastPunch) simple as that. Note that we ALSO update the hidden field PB2 with a ‘0’ so that our ‘button state’ is reset.
  • wrtsection(‘thepage’); Actually in this first iteration we have only one “section” which is the whole page.  wrtsection writes data to the server.
  • exit – just a cleanup routine that tells the server than we are done writing data.  It is flushed out to the browser at this point.

So that is basically it.  A web based app which *could* be called from a mobile device browser if you wanted to. It is pretty lightweight so it should be fairly performant.  In the first post on this subject, I talked about being a good citizen when it comes to data transfer – move as little data as possible.  We can improve this data movement and we will explore those options when we make this app much more mobile friendly.

What does this look like.  Well, like our 5250 app, it ain’t much to look at:

 

 

 

 

 

 

 

 

 

 

 

Missing is the “Exit” button.  Simply close the browser window to exit!  You’ll notice I added a small feature improvement in the web version of our timeclock you can now list the punches that have been recorded.  Not much of a feature improvement but, one step at a time!  Here is what that page looks like:

 

You can check out the code which you can download from here: The code is compiled for V6R1 (IBM i 6.1).  I’ll try to get it recompiled *PRV so it will be happy about a download for V5RM0.

The next step is to use HTML5 to dress up the web pages, add a little JSON and Ajax and make this a bit more mobile friendly!  Coming soon!  Happy New Year!

 

Comments Off on Mobile application development and IBM i (Part three) – To the web!

Mobile application development and IBM i (part Deux)

Running a little later on this second post because I had to write a 5250 green screen version of our timeclock punch program.  Like most new things I do, I try to actually learn something new when I go forward with a new project.  ALWAYS!  So there is rarely any same ol, same ol when I write code.  If you are writing the same code over and over for every application you create you are just a programmer.  If you try a new approach or a new language feature every time you write an application then you are a developer.  If you try new approaches and new language features and wholly new languages every time you develop an application, well, you are a nutcase like I am.  But I thrive on new stuff so…..

OK!  So here is what the application does:

When you run the app you see a screen with a Punch In, Punch Out, and Exit button (Using MOUBTN was the “new” thing for me).  The screen displays the time, the date and the last punch on the clock.  If you click on the ‘Punch IN’ button OR Press F6, an IN punch is recorded and the program exits.  If you click on the ‘Punch OUT’ button OR press F7, an OUT punch is recorded and the program exits.  If you click on the ‘Exit’ button OR press F3, the program exits.

The application screen looks like this:

MOUBTN may not be supported on your 5250 emulator and that is why I include the function keys as well.  Also, you may say, “Where is the security here? Anyone who can run the program can punch in as employee 55”! Yep. You didn’t think I was going to do ALL the work for you did you?  Besides that is a trivial plumbing job and would have to be adapted to your employee master file anyway.

So, where is the code?  You can download the zip that contains the save file here:

The source is included in the save file and it was saved at V5R4M0 ( I am running 6.1 and 7.1 in two partitions).  The text version of the program source can be found here and the text version of the DDS can be found here. It ain’t the prettiest code but the FBU  (functional but ugly) approach always works for me.

Go ahead and run the program a few times to get the gist of it.  It’s pretty simple and I plan to follow the KISS pattern for the remaining steps that take that 5250 stuff to the web and then mobile web world.

So you are still chomping at the bit to write some Mobile app code?  Ok, Ok, I hear you. The next installment will be a web version of our 5250 Punch Clock program and from then on it just gets easier and easier….(honest).

Comments Off on Mobile application development and IBM i (part Deux)

WP Login