Sunday, November 30, 2008

2e and your support network

Updated - 12/06/2009
I recently received a communication via the blog feedback feature. It was from one of our colleagues in France who was a little concerned about the support he receives from CA and also the usage of the tools in general.

There are quite a lot of interweaving discussions to answer his question below.

"In France,we have CA/2E 8.1SP1fr RPG.Here,we have no news from this product,it seems dead! We have to contact US support to obtain some news/upgrades,it's very difficult to have a schedule of upgrades.We use 2E since 95 and nothing has changed in the way of using it. Please reply to discuss. Thanks. "

So I guess I need to answer each of these and share some opinion along the way. After all, isn't this the point of a blog in the first instance.

Is it Dead?

Well the short answer to that is "NO". A quite emphatic one actually. CA have a roadmap for the 2e product with a host of community voted enhancements being included in 8.5 (GA July 2009, I understand). I am sure these were discussed at CA World. There was also a call from Daniel Leigh recently to the community about utilising Web Services directly in 2e as well as catering for the creation of ILE service programs from within the toolset.
I have been part of the Alpha and Beta testing and these is certainly some good potential in these areas.

Keeping updated about the product.

CA is a big company and I would guess that the local offices are often the last to know about product centric announcements. The guys responsible for the 2E and Plex products are particularly vocal online and via a series of user groups. The US is the biggest installed base for these products so I guess it is only right that the focus starts states side. You can sign up to the forums, my blog and other fan sites as well as the Plex2E PLC (Product Line Community). Not to mention the local user groups in some regions. US and UK.

There is also Alpha and Beta testing programmes which I encourage you to consider.

Other useful links below which I have also added as a dedicated link on the blog home page.

The CA Forums

http://caforums.ca.com/ca/?category.id=caplex

Communities Product Line Community

http://causergroups.ca.com/usergroups/UserGroupHome.aspx?ID=391

Also check out the other links I have on the blog home page. I link to the Plex and 2e Wikis which are resources we can all contribute to as well as specialist sites of key CA product partners.

Once you are a member of the PLC you will receive very regular updates from Bill Hunt and the team as well as invitations to webcasts.

And then you always have the other forums around the platforms the tools generate for. i.e. SystemiNetwork, although I guess this will be changing its name again soon once the Power System branding gains momentum.

Upgrades.

CA have explained in the past on numerous occassions and the release schedule would confirm this, they issue major upgrades for the products every two years. Service packs in between which add functionality as well as a fix roll up. See the CA website for more details about each of the product roadmaps along with release and support cycles.

On a side note SP2 has been available for quite a while (November 2007) and as I referred to earlier 8.5 is GA for July 2009.

Features introduced into 2e in recent years.

The following link (on the 2e wiki) highlights the changes that have been added to 2e in recent years. If you are considering or using Plex also then you should check out it's wiki also. See the links at the top of the blog.

http://wiki.2einfo.net/index.php?title=Versions

Depending on how you use the tool or how you have approached extending the tool would dictate which of the features you are using. Often, as the tool has been around a while we just use it as we always have. Not too different to those of us who use Word as if we were using Word for Office 4.3 instead of 2007.
If you are into componentisation of your 2e systems then you will be utilising many of the other features. However, there is no right or wrong way to use the product, simply what works for you. But do take a look at what is there and see if the new features can be applied to your environment.
I was quite shocked to see on a recent PLC 2E users survey that many shops are still on 7.0 and some on earlier versions.
My strong and hence bolded recommendation here is to get current.

Certainly 15 years ago the focus was that 2e generated every aspect of your system. Nowadays if forms part of a hetrogenous platform of servers and tools.

The base tool has remained largely the same with the focus on value add but 8.5 has quite a few base tool enhancements. I like the filtering now. Very neat. And recent releases have had quite a lot of neat shortcut function keys and subfile options that can increase developer productivity.

Lastly, I guess there is also the advent of the internet. With so much information available, if we are not sourcing our information via the net then we could be missing out on lots of it. And if we looked closely or joined the PLC you would know about the 4th Annual conference taking place in Ft Lauderdale, Florida, USA in September 2009.

Thanks for reading.
Lee.

Tuesday, November 18, 2008

What next?

My regular followers for which there are many. I am pleased to say that I have over 100 unique visitors per month visiting the blog and the number is increasing. If have dabbled with a mixture of real life stories and content, technical 2e content, management styles, observations about software development and a couple of other stories related to me and my experiences as long as there is a loose IT twist.

I have spent much of the last two months writing more about 2E. I plan to finish off my posts in this area over the coming months and years. I certainly have plenty of material left.

Finish 2e Development Standards
Model Management
Database Adminstration Guides
Advanced Development Techniques
Model Tidy
Modernisation Options for 2E generated systems
Plex Development

........ are all blog series candidates in their own right.

I thought that I'd take a week off this week and ask you the readership what you would like to see. The hits to date make it a worthwhile exercise for me to put this content on the web. If you have any content you wish to share, requests for additional coverage then place a comment on the blog and I'd be happy to start doing some of this for you.

So.

Let me know. I reckon I have a year or two left in me looking at my current roadmap. A little more now won't hurt.

I look forward to hearing from you.

Thanks for reading.
Lee.

Wednesday, November 12, 2008

2e Development Standards - (Composite Functions)

Todays topic is composite functions.

I have said before that there are many ways to skin a cat and with development regardless of tools and languages used, it is no different.

To date I have concentrated on the generic principles of development and also on the CA 2E tool from Computer Associates. I have put quite a few posts in place around 2E with many many more to go. To be honest I am less than 20% through what I intend to post from the technical perspective and I have barely touched the Plex product. Still good things come to those who wait.

http://www.dictionary.com/ has the definition of 'composite' as "made up of disparate or separate parts or elements". In 2E terms it means the linking of two or more functions to serve a business purpose. For example to clear a file using 2e function types you may either call a EXCUSRPGM and use the operating system or you may chose to use a RTVOBJ with no restrictor/positioner keys and then call a DLTOBJ for each record in the file. You could also call a SQL routine, embed the OS400 command in a message etc etc etc. You get my point. The composite in this example is the RTVOBJ/DLTOBJ combination.

There are other composite types that are more often encountered. Especially around creating or changing records in a database file (table for the SQLites amongst you).

I have created functions named CRT/CHG or CHG/CRT to solve a common problem of what do do if the record does or does not already exist in the database.

This lead me to consider is there is a preferred default method and are there any variations. Once again a big thanks to Ray for his contributions here.

CHG/CRT v CRT/CHG

There are times when if a CRTOBJ fails due to the record already being in existence or a CHGOBJ fails because the record does not exist. To solve these issues we generally create combination functions named either CRT/CHG or CHG/CRT. Or if you follow my recommended standards and if these are default functions then they would be named *CRT/CHG or *CHG/CRT.

In general you should select the one that is most likely to succeed, so depending on your knowledge of the environment and the data being processed, if the record is likely to not be there then you need to use the CRT/CHG combo.

There are some performance considerations over and above the availability or otherwise of the underlying record.

A CHGOBJ that contains a CRTOBJ if a record does not exist is inefficient as it generates the following code. This is particularly true for SQL generation.

Pseudo SQL Code

DECLARE CURSOR FOR UPDATE
FETCH
UPDATE if record found
INSERT if no record found
CLOSE CURSOR

Pseudo RPG Code

CHAIN
UPDATE if record found
SETLL & INSERT if no record found

An alternative coding style with a CRTOBJ calling a CHGOBJ if record already exists will generate the following code. The CHGOBJ must be an 'update style' that does not use a cursor.

Pseudo SQL Code

SELECT by key
INSERT if record not found
UPDATE if record exists

Pseudo RPG Code

SETLL
WRITE if record not found
CHAIN & UPDATE if record exists

A CHGOBJ with a little bit of grunt.

To create an 'Update style' CHGOBJ:-

For performance reasons we need to omit the prior SELECT generated for SQL CHGOBJs. This is mainly for CHGOBJs called repeatedly in batch type processing. But it can only be done if there is no requirement to read existing DB1 context fields. To do an immediate update we need to create a special version of a CHGOBJ called an UPDATE function. This will have following characteristics:-

1 - Ensure that there is no coding inside the CHGOBJ. Commonly we must transfer the timestamp coding from inside the CHGOBJ to input parameters and setting the timestamp fields directly on the CHGOBJ call.

2 - Ensure that the CHGOBJ parameters are defined in the default way using the UPD ACP structure. Fields that do not need to be changed should be made NEITHER parameters.

3 - The CHGOBJ function option for Null Update Suppression should be = No. This ensures that there is no attempt to perform an image check.

4 - UPD style CHGOBJs should ideally only have the attributes that are being changed. This is particularly important when calling a CHGOBJ from inside a RTVOBJ over the same file. Passing in DB1 context for those filed not being changed is not conducive to performance since the optimiser cannot differentiate between changed & non changed attributes.

Thoughts, opinions, concerns or fanmail gratefully accepted. Cash donations to charity please.

Thanks for reading.
Lee.

Thursday, November 6, 2008

2e Development Standards - (Hints and Tips DLTOBJ)

The humble DLTOBJ is the topic of this weeks post. This finishes of the series on the main 2e internal function types. I have covered the RTVOBJ, CRTOBJ and CHGOBJ so far. Next weeks post will be about the mertis of using a CRT/CHG or CHG/CRT combination function.

Following that I will be blogging about standards for EXCUSRSRC, EXCUSRPGM and the EXCINTFUN/EXCEXTFUN function types before moving on to a series on the screen function types.

So plenty to get though over the next few weeks. For those of you following the series, bare with me as I get these completed and published.

Back to todays topic. The delete object (DLTOBJ).

General considerations.

Only one DLTOBJ, the default (*DLT), should be present on any file. It will have no action diagram coding added.

If other associated files must be deleted or updated at the same time as the DLTOBJ. An EXCINTFUN or RTVOBJ should be created as a standard wrapper and named *DLT (Cascade).

You can use a DLTOBJ to clear an array. Simply create the DLTOBJ function over the array and remove all keys. Note this technique is not applicable for files. You should prefix the array clearing delete with CLR. I.e. "CLR Standards Sample" dropping the ARY prefix from the actual array. Note: If using the Cobol generator then this is inefficient and you are better to use the traditional RTVOBJ/DLTOBJ approach.

Auditing at record level. Remember that you no not need to add auditing records for any entry you are deleting.

Gotcha's

It is not possible to suppress the error message if the record to be deleted does not exist. Therefore if the DLTOBJ is conditional it should be called from a RTVOBJ based over the same file. Note: If called directly then the *Return code must be set to *Normal as deleting a record that is no there is generally not considered and trapped as an error.

Thanks for reading.
Lee.