Thursday, 13 August 2009

CVS in iSeries PASE

I've been playing at getting CVS running in iSeries (i5/AS400) PASE...

The steps that I have followed so far have been:

1. Downloaded AIX CVS binary from http://ftp.gnu.org/non-gnu/cvs/binary/feature/powerpc-aix/cvs-1.12.13-AIX.bin.gz

2. Unzipped binary into /usr/local/cvs

3. Created a symbolic link to the binary in /QOpenSys/usr/bin :-
ln -s /usr/local/cvs/cvs-1.12.13-AIX cvs

4. Created a 'cvs' user profile - a basic *USER class user profile (I actually copied it from the PHP "nobody" user profile and set the home directory to /home/cvs)

5. Added an entry to /QIBM/UserData/OS400/INETD/inetd.conf
pserver stream tcp nowait cvs /QSYS.LIB/QP2SHELL.PGM QP2SHELL /QOpenSys/usr/bin/cvs cvs -f --allow-root=/cvsroot pserver

6. Add the service entry
ADDSRVTBLE SERVICE(pserver) PORT(2401) PROTOCOL(tcp)

7. Initialise the CVS repository
cvs -d /cvsroot init

8. Start INETD
STRTCPSVR *INETD

When I try and test this locally, things seem to be OK.

In a PASE terminal (CALL QP2TERM) I can create and import a test file:-

export CVSROOT=/cvsroot
mkdir /test
echo "I am a test" > /test/test.text
cd /test
cvs import -m "Test Import" Version-1 Revision-1

With the response :-

N test/test.txt

No conflicts created by this import

So, CVS is installed and running from that point of view..

However trying to access the service remotely (or via loopback to localhost) has thrown up a bit of a problem. When I try and log in to the cvs service as follows:-

cvs -d :pserver:user@server:/cvsroot login
CVS Password:

cvs [login aborted]: end of file from server (consult above messages if any)

If I try and telnet into port 2401 I get gobbledigook :-

õòÆòûªò@âûööüòäz@yâÑó}%%├ÕÔ@âûööüòäó@üÖàz%@@@@@@@@üää@@@@@@@@@@┴ää@ü@òàª@åëôàaäë
@úû@úêà@ÖàùûóëúûÖ¿%@@@@@@@@üäöëò@@@@@@@@┴äöëòëóúÖüúëûò@åÖûòú@àòä@åûÖ@Öâó%@@@@@@@
@üòòûúüúà@@@@@Ôêûª@ôüóú@ÖàÑëóëûò@ªêàÖà@àüâê@ôëòà@ªüó@öûäëåëàä%@@@@@@@@âêàâÆûñú@@
@@@├êàâÆûñú@óûñÖâàó@åûÖ@àäëúëòç%@@@@@@@@âûööëú@@@@@@@├êàâÆ@åëôàó@ëòúû@úêà@Öàùûóë
%@@@@@@@@äëåå@@@@@@@@@Ôêûª@äëååàÖàòâàó@éàúªààò@ÖàÑëóëûòó%@@@@@@@@àäëú@@@@@@@@@Ãà
@Öàüä¿@úû@àäëú@ü@ªüúâêàä@åëôà%@@@@@@@@àäëúûÖó@@@@@@Ôàà@ªêû@ëó@àäëúëòç@ü@ªüúâêàä@
%@@@@@@@@àºùûÖú@@@@@@@┼ºùûÖú@óûñÖâàó@åÖûö@├ÕÔk@óëöëôüÖ@úû@âêàâÆûñú%@@@@@@@@êëóúû
@@@@@@Ôêûª@ÖàùûóëúûÖ¿@üââàóó@êëóúûÖ¿%@@@@@@@@ëöùûÖú@@@@@@@╔öùûÖú@óûñÖâàó@ëòúû@├Õ
k@ñóëòç@ÑàòäûÖ@éÖüòâêàó%@@@@@@@@ëòëú@@@@@@@@@├Öàüúà@ü@├ÕÔ@ÖàùûóëúûÖ¿@ëå@ëú@äûàóò
}ú@àºëóú%@@@@@@@@ôûç@@@@@@@@@@ÎÖëòú@ûñú@êëóúûÖ¿@ëòåûÖöüúëûò@åûÖ@åëôàó%@@@@@@@@ôû
@@@@@@@@ÎÖûöùú@åûÖ@ùüóóªûÖä@åûÖ@üñúêàòúëâüúëòç@óàÖÑàÖ%@@@@@@@@ôûçûñú@@@@@@@┘àöûÑ
@àòúÖ¿@ëò@KâÑóùüóó@åûÖ@Öàöûúà@ÖàùûóëúûÖ¿%@@@@@@@@ôó@@@@@@@@@@@Ëëóú@åëôàó@üÑüëôüé
@åÖûö@├ÕÔ%@@@@@@@@ùóàÖÑàÖ@@@@@@ÎüóóªûÖä@óàÖÑàÖ@öûäà%@@@@@@@@Öüòòûúüúà@@@@Ôêûª@ôü
@ÖàÑëóëûò@ªêàÖà@àüâê@ôëòà@ûå@öûäñôà@ªüó@öûäëåëàä%@@@@@@@@Öäëåå@@@@@@@@├Öàüúà@}ùü
}@åûÖöüú@äëååó@éàúªààò@Öàôàüóàó%@@@@@@@@Öàôàüóà@@@@@@╔òäëâüúà@úêüú@ü@Èûäñôà@ëó@ò
@ôûòçàÖ@ëò@ñóà%@@@@@@@@ÖàöûÑà@@@@@@@┘àöûÑà@üò@àòúÖ¿@åÖûö@úêà@ÖàùûóëúûÖ¿%@@@@@@@@
@@@@@@@@@ÎÖëòú@ûñú@êëóúûÖ¿@ëòåûÖöüúëûò@åûÖ@ü@öûäñôà%@@@@@@@@Öôó@@@@@@@@@@Ëëóú@åë
@ëò@ü@öûäñôà%@@@@@@@@Öúüç@@@@@@@@@┴ää@ü@ó¿öéûôëâ@úüç@úû@ü@öûäñôà%@@@@@@@@óàÖÑàÖ@
@@@@@@ÔàÖÑàÖ@öûäà%@@@@@@@@óúüúñó@@@@@@@─ëóùôü¿@óúüúñó@ëòåûÖöüúëûò@ûò@âêàâÆàä@ûñú
@åëôàó%@@@@@@@@úüç@@@@@@@@@@┴ää@ü@ó¿öéûôëâ@úüç@úû@âêàâÆàä@ûñú@ÑàÖóëûò@ûå@åëôàó%@
@@@@@@@ñòàäëú@@@@@@@õòäû@üò@àäëú@âûööüòä%@@@@@@@@ñùäüúà@@@@@@@┬Öëòç@ªûÖÆ@úÖàà@ëò
@ó¿òâ@ªëúê@ÖàùûóëúûÖ¿%@@@@@@@@ÑàÖóëûò@@@@@@Ôêûª@âñÖÖàòú@├ÕÔ@ÑàÖóëûòMó]%@@@@@@@@ª
@@@@@@@@Ôàú@ªüúâêàó%@@@@@@@@ªüúâêàÖó@@@@@Ôàà@ªêû@ëó@ªüúâêëòç@ü@åëôà%MÔùàâëå¿@úêà
@``êàôù@ûùúëûò@åûÖ@ü@ôëóú@ûå@ûúêàÖ@êàôù@ûùúëûòó]%

Connection to host lost.

This looks like your typical ASCII/EBCDIC translation type stuff - but PASE is an ASCII environment and I am using INETD to connect straight through to the QP2SHELL program which gives me access to PASE for CVS. A little confusing and I'm not sure where to go next with this.. I'm wondering if the QTOGINTD program is getting in the way..

You also similar output (but not identical) when you try and telnet from within i5/OS to port 2401 on localhost.

I think I'll see if there's a way to get this running as a pserver without using inetd...

Friday, 4 July 2008

Getting hyperlinks right in Webfacing

If you've ever added a hyperlink to a character field in WebFacing, you may well have seen links with an underline extending beyond the actual text if the field's value doesn't take up the entire length of the field.

There are a couple of ways of addressing this - the first is obviously to change your stylesheet so that hyperlinks are denoted with something other than an underline - changing the colour or making the text bold.

The following change to the css will make your hyperlink dark blue for example...

a, a:link, a:visited {
text-decoration: none;
color: #3F73A6;
}


We don't always have the luxury of being able to style the underline away from our hyperlinks though. The customer's requirements and in-house standards might well dictate that they want the hyperlinks to be underlined.. and they don't want a mess!

Select Web Settings > HTML Overrides
Check the 'Override generated HTML' checkbox and select the 'Insert' radio button.

Select the "Before" tab and enter the following code, replacing the with the values that are pertinent to your application:

<% if (!isProtected) { %>
<a href="#" onclick="<javascriptCode>"><%=<recfmt>.getFieldValueWithTransform("<field>",QUOTED_TRANSFORM).replaceAll("( )*$", "")%>
<% } else { %>
<%=<recfmt>.getFieldValueWithTransform("<field>",rrn,QUOTED_TRANSFORM).replaceAll("( )*$","")%>
<% } %>


<javascriptCode>- Specify the javascript code that you want to be executed when the link is clicked.
<recfmt>- The record format with the field that you want to turn into a hyperlink
<field> - The field name that you want to turn into a hyperlink (bear in mind that Webfacing translates certain characters (e.g. '#') into replacement values)

In the "inside" tab, enter the value ' style="display:none" '

Thursday, 3 July 2008

Is RPG Dead?

I rejoined the RPG mailing list over at midrange.com this week to seek assistance with a problem I am having with decrypting TripleDES in RPG. I started scrolling through the group's recent messages and came across a discussion about an interesting (if recurring) question - is RPG dead? Now I'd like to have contributed into that discussion directly - but I've seen too many discussions on that list descend into handbagging and ad hominem attacks. I wanted to put my thoughts on the topic together though which persuaded me to resurrect my blog and put my thoughts down here.. hopefully I'll stick around and do something with this blog this time :)

Well, the short answer is obviously that no, it isn't dead. It continues to be supported and developed by the Toronto Lab and will probably continue to be so while there are still customers using the platform.

However, I think it's also fair to say that the very fact that the discussion occurs is symptomatic of the decline in the language. You don't get discussions in the Ruby community or the Java community about whether their language is dead. It just doesn't come up.

For those that aren't aware, RPG (or Report Program Generator) is a proprietary IBM language that only runs on the IBM System i5 (the current incarnation of the iSeries/AS400/System 3x).

RPG is therefore a niche language. It is also the first programming language that I ever learned. Its strength is its tight integration with the DB2 database and the i5/OS (OS400) operating system. However that is also one of its main weaknesses - its tight coupling of applications to the DB2 database and the operating system.

The discussion on midrange.com inevitably focussed on technical aspects of the language - its syntax, its functions - it compared procedural programming with object oriented programming... and entirely missed the point. The question about what platforms and languages that organisations will adopt is entirely a business question. Business decision makers don't generally care about language features, operation codes or floating point arithemetic. They care about the availability and cost of skilled workers, the total cost of owning and maintaining a platform... and like it or not they care what people like Gartner tell them - which is that RPG is in decline.

The future of RPG is also tied to the future of i5/OS. How many new installations of i5 systems did IBM undertake last year? How many times did they actually sell the system to a new user, rather than upgrading an existing user's box? I honestly don't know the answer to this question, but I don't think that the answer would be very many - if any. I don't know what would persuade someone to make a new investment in a System i machine.

IBM has blurred the lines between its System i and System p lines in recent years. They are all but identical now and will surely merge in the not too distant future. i5/OS will continue to be maintained as long as there are customers that make it financially viable and RPG will continue along with it as long as the members of the Toronto team remain with IBM. Bigger businesses will gradually move off of the platform whilst smaller ones remain and try to get the most out of their investment for as long as possible. As the average age of members of the i5 community continually rises and people retire, the availability and cost of the skills will push more and more businesses away from the platform - whilst the lack of future prospects in the language will prevent it from being taken up by a younger generation that already sees their chances of long-term employment in the IT industry under threat from offshore outsourcing.

RPG is a niche language now, it isn't growing, its use is declining - but it will be around for a long while yet. There are just too many lines of code in production in too many enterprises for anything else to be the case.