Wednesday, 20 June 2012

Ways of handling XML and web services calls from RPG #ibmi

Someone asked me an IBM i/RPG/XML question yesterday and I couldn't find a simple summary of the options available, so I put one together - if I missed a suitable link, or if there are errors/omissions in this, please comment.

This list excludes the various third party options available.

Low-level reading and writing of XML direct from RPG code:

  • Parse: XML-INTO and XML-SAX RPG opcodes (V5R4 onwards)
  • Generate: Roll your own (not difficult, but not standards-based and not very maintainable)
  • Parse and Generate: XML Toolkit, 5733-XT1 (V5R4), 5733-XT2 (V6R1 onwards): usable from any ILE language, but complex to use direct; a ‘wrapper’ called XML4PR is provided to simplify usage from RPG
  • Best way of all, potentially: Open Access handlers, once these become available (apparently under development by IBM STG Lab Services) – have the potential to hide all XML parse and generate complexities from the programmer – I imagine they would be chargeable though (V7R1 onwards)

Consuming web services direct from RPG code:

  • Web Services Client for ILE: provides a way (WSDL2WS tool) of generating a ‘proxy’ C or C++ service program, although this is complex to invoke from RPG – recently simplified by incorporation of WSDL2RPG tool, which generates an RPG ‘proxy’ instead

Alternatively:

  • Use your chosen open source Java XML and web services client functionality, invoking your Java classes from RPG
    • Pro:
      • This may be the simplest/most maintainable way to do it, especially if you make use of the Java Toolbox record access classes to handle external description
    • Con:
      • Configuration management of the necessary open source jar files may be an issue (you are also likely to duplicate functionality that is now built in to IBM i, e.g. Apache Axis open source web services layer)
      • Getting the performance right may take considerable effort the first time
      • Change management/source code control may be an issue unless you have other non-J2EE Java code in production

XML-based data storage and retrieval (XML SQL datatype) from RPG code:

Sunday, 20 May 2012

Two operating systems, and rubbish customer service from a 'phone manufacturer

Two Saturdays ago I woke to find my Windows Phone (Samsung Omnia 7) was on a major go-slow - it was fine for anything not involving the built-in secure SD card, but I couldn't even do a hard reset. The (always excellent) Bath T-Mobile shop agreed with my provisional diagnosis and sent the 'phone back to Samsung for repair, providing me temporarily with a little Nokia 'phone which proved surprisingly full-functional (if you can live without 3G and with a storage capacity of about 50MB, that is).

In the meantime I decided that it was time I stopped evangelising Windows Phone from a position of knowing nothing about either iOS or Android, so I bought myself a 7" Ice Cream Sandwich tablet (Neuropad). An interesting and overall positive experience.

For:

  • Good and clearly responsive supplier (AndroidSlates via Amazon)
  • Brilliant battery life - I never turn it off
  • Pretty intuitive (though it took me a while to work out how to display the app list - initially, I was faced with what seemed a completely blank screen)
  • Clearly excellent selection of apps (though I have installed no functionality that doesn't exist for WP7, except BBC iPlayer)
  • Perfect for productive train travel - handle emails, read PDFs without straining eyes
  • Good wifi reception (could use a 3G dongle if I needed to)
  • File Explorer, and ability to map tablet as network drive via USB
  • Good support for Windows Live and SkyDrive, once you've found the apps (why call the WL app Hotmail?)
  • Nice implementation of OneNote Mobile (free of charge, and with far faster sync than on WP7)
  • Respectable Office document editor (Documents to Go) for under £10 (though the PowerPoint element is feeble)
  • Flash (iPlayer app works perfectly ... but see below for the other side of this story)
  • 'Running apps' list with 'close' function (I see now why the relevant request has so many votes on windowsphone.uservoice.com)

Against:

  • Can't launch attachments from OneNote pages (now using SkyDrive direct instead, but it's not as seamless)
  • Billing complications - Amazon option doesn't work in the UK as far as I can see; Google Play allows entry of an Amex card, but then doesn't let you use it for Android app payments, without explanation
  • Can't see the back / home / menu buttons in the dark (surprisingly annoying)
  • Even on max volume, Neuropad is pretty quiet
  • Non-integrated email (why should I care whether it's Gmail or not?)
  • Contact handling is not at all intuitive - took me a while to work out where it was finding contacts, and even longer to identify/install a decent app to manage them with - no built-in contact management app at all (even the little Nokia mentioned above did better than that)
  • Apps fairly frequently stop responding - may be related to trying to do too much with small memory in Neuropad (fair enough) and/or to bad wifi reception
  • Flash (even worse than on Windows, e.g. Cricinfo website is unusable)

Lots more to do - install and learn Swype keyboard, find better browser, etc. - but overall v pleased with it. However I have seen nothing to make me think I would be better off with an Android 'phone.

Meanwhile after only 10 days the Windows Phone was ready for collection.

Samsung informed us in writing that they had tested everything in sight and 'updated the software to the latest level'. We were puzzled, given the fact that there'd fairly obviously been a hardware fault.

On investigating the 'phone and switching it on, it became clear
a) that this was not my 'phone handset but a rather battered looking replacement they hadn't bothered to mention (so my carefully preserved Zune backup would be useless), and (worse)
b) that, far from being on the 'latest level', it was on the very earliest shipped OS level (7004).
I think the politest way of describing Samsung's actions here is 'economical with the truth'. I can't see that they give two hoots about their customers. I'm as angry about this as I have been with a vendor for a long time - it feels like they're taking both the Bath T-Mobile shop and me for fools.

Anyway three hours, much swearing at Zune, a PC restart, and 4 updates later, I was ready to re-install my apps and get things back to normal.

In summary: much as I love my Omnia, my next 'phone will probably be a Nokia Lumia 900; and it won't be running Android.

Tuesday, 15 May 2012

The #ibmi timeline up to date


What an amazing story ...

System/3 1969-1975 Product of General Systems Division, formed as result of anti-trust legislation. Low-end batch system replacement for unit-record equipment. Used RPG programming language. Disk and terminals soon added. 28-instruction CPU. Over 25,000 sold.
System/32 1975-1977 System/3 follow-on.
System/34 1977-1981 System/32 follow-on. Ran SSP OS.
System/36 1981-1986 System/34 follow-on. Ran SSP OS.
System/38 1978-1988 Pioneering design, revolutionary architecture system, continued in AS/400, iSeries, System i5, IBM i to date, provides complete insulation for user applications against technology change. Also, first system line to include in-built relational database system. Ran CPF OS.
AS/400 1988-2000 Repackaged and improved S/38, hugely successful in medium business markets, using S/38 architecture. By mid-late 1990s, became open, e-business capable server. 200,000th AS/400 sold by 1992. OS/400 OS. From 1995 based on RISC chip (PowerPC).
iSeries 2000-2002 Repackaged and re-branded AS/400, under eServer strategic initiative.
New iSeries 2003-2004 Radically reshaped and extended, repackaged and re-priced iSeries, repositioned as "On Demand" e-business hub platform consolidating Windows/Intel, Linux, AIX, Java and Domino (as well as traditional OS/400) workloads. Over $500M IBM investment.
System i5 2004-2007 Technology convergence with pSeries, including AIX in a partition. Operating system now called i5/OS.
IBM i on PowerSystems hardware 2007- No distinction between i and p hardware - all just Power Systems. Operating system now called IBM i.
IBM i on PureSystems platforms 2012- Expert integrated systems: ranges of infrastructure and application platforms with full support for IBM i workloads.

Sunday, 6 May 2012

Assorted #ibmi hints and tips #4 : Creating an output table directly from a SQL SELECT

Another only recently learned but mega useful SQL trick ...

create table schema/table as (select statement) with [no] data

e.g.
create table MYLIB/MYOUTPUT as (SELECT COLUMN1, COLUMN2, COLUMN3 FROM ...) with data
creates physical file MYOUTPUT in MYLIB with fields COLUMN1, COLUMN2, COLUMN3  and populates it with the SELECT result set, while
create table MYLIB/MYOUTPUT as (SELECT  COLUMN1, COLUMN2, COLUMN3 FROM ...) with no data
creates empty physical file MYOUTPUT in MYLIB with fields COLUMN1, COLUMN2, COLUMN3, and
create table MYLIB/MYOUTPUT as (SELECT  * FROM MYLIB/MYINPUT) with data
does the equivalent of
CPYF MYLIB/MYINPUT MYLIB/MYOUTPUT MBROPT(*ADD) CRTFILE(*YES).


It's worth pointing out that the columns of the SELECT have to have valid field names, thus
create table MYLIB/MYOUTPUT as (SELECT COUNT(*) FROM ...) with data
will not work, while
create table MYLIB/MYOUTPUT as (SELECT COUNT(*) AS MYCOUNT FROM ...) with data
is fine.


The newly announced RUNSQL CL command will make the above even more useful, as it will make it immediately accessible from CL.

Friday, 4 May 2012

Assorted #ibmi hints and tips #3 : Handling multi-member physical files from SQL



Here's another useful possibility I hadn't spotted until recently.
For SQL access to a non-default member, use an alias, e.g.:
CREATE ALIAS QTEMP/MYMBRB FOR MYSCHEMA/MYTABLE (MBRB)

By the way, if you missed hint #2:
Assorted IBM i hints and tips #2: Making physical file DDS changes faster, easier, and less risky  Nice article at 

Saturday, 21 April 2012

Assorted IBM i hints and tips #1: CREATE TABLE authority setting #ibmi

This one caught me out recently:
If you do an SQL CREATE TABLE using JDBC with the default *SQL ('.' separator) naming convention, the system always sets AUT(*EXCLUDE); the normal object creation default of AUT(*LIBCRTAUT) is ignored.
To force AUT(*LIBCRTAUT), use the *SYSTEM ('/' separator) naming convention, by adding ;naming=system to the end of the JDBC URL.

Thursday, 19 April 2012

i-Community initiative for #ibmi users in the UK

A new initiative for UK IBM i users is now up and running.

i-Community is aimed at maximising the benefit of your IBM i investment, by sharing experiences and concerns with your peers, and through face-to-face meetings led by top speakers.

i-Community is a non-commercial environment; it is not aimed at marketing any product or service, rather it is a non-profit-making peer group facilitated by its sponsors, five IBM Business Partners (Applied Technologies, Binary, CSI, MITL, iPerimeter). Numbers of session attendees are kept low enough to permit a high level of interaction. The full annual membership subscription covers all costs for one delegate at our spring UK meeting and on the autumn visit to the IBM Rochester Laboratories, including the return flight to Minneapolis, with a small uplift to cover overheads. A UK-only subscription is also available.

i-Community sessions will be realistic, example driven, and will typically look at the subject area from both a technical and a business viewpoint. The topics covered are chosen by the community to cover IBM i infrastructure and development matters, but also non-IBM i-specific subjects of general interest to members, such as SOA, compliance or unified communications. Topics might occasionally be led by groups of members, with an IBM representative present to handle questions. It is the organisation that is the member, not any individual, so attendees can be chosen to suit the topic.

Each organisation signs a Confidential Disclosure Agreement with IBM Rochester, providing members with access to the futures information they need for budgeting.

More details are at www.i-community.org.uk, and the inaugural meeting is on Wednesday 16 May at Wroxall Abbey near Warwick, with dinner/overnight stay on Tuesday 15 May – here is the agenda:
IBM POWER i and i/OS Update: Nigel Adams - IBM UK
PowerHA and i/OS: Stu Stebbings - IBM UK
VIOS and POWER i / AIX workloads: Tom Watts - IBM UK
Rational Development Tools for Power i/OS: Pat Flisher - IBM UK
Enterprise Service Bus - WebSphere Messaging: Dave Willmott – CSI
 
The charges are:
Membership to include UK event only: £250 plus VAT (additional attendee £175 plus VAT)
Membership to include both events in 2012: £1,850 plus VAT
 
Do let me know (01225 436302 or mandy.shaw@iperimeter.co.uk) if you want to know more about it, or if you are at all interested in getting involved.