Excel and ISPF automation resource

Not all mainframe tools are created equal

0 comments
Allan (a former colleague who is now working for Accenture Dublin) needed some direction on one of his tasks. He needed to remove extra spaces on fields found in a file. Each 600-byte record is composed of 50 pipe-delimited fields. It is a simple task normally done through ISPF Edit (change) command.

Not this one.

The file involved contains more four hundred thousand records. Given the size, it is not possible to open the file in Edit mode. The only choice he have for the update is through code.

Choosing the right tool.

Most developers will do this in Cobol using indexing techniques on character arrays. The issue with this approach is its inefficiency. given that each character in the 600-byte record needs to be checked (and potentially moved), the amount of CPU processing needed is high. Multiply this by 400,000, then it becomes prohibitive.

There are others who will opt for interpreted languages. commonly used are CLIST, REXX, Easytrieve and SAS. Using some of these may result to less CPU processing but not low enough to be acceptable.

Allan knows about the issues with these approaches. Instead they turn their focus on utilities mainly used for data manipulation. As suggested by his team mate, they considered using Fileaid. Based on experience, I mentioned that Fileaid requires high CPU time that it may not be suited for their need. True enough, their testing confirmed this as it took 1.5 minutes (CPU time) to process just 2000 records.

For this task, DFSORT/Syncsort will be a good tool to use. Allan was somewhat expecting my suggestion as he saw me use them extensively in the past. With five lines of code and a quick test, they found an acceptable solution. Their sample run of 15000 records only took .03 minutes (CPU time) to complete.

This is why being familiar with what your mainframe system has to offer is crucial. In today's world, the accomplishment of the task is not enough. Doing it efficiently should be our goal. With mainframe's long history, a wide range of utilities is available to us. Many of these have overlapping functionalities. This is your key to be able to find the efficient solution suited for your task. There no easy way to do this but but to continuously explore the tools in your system.
 

Copyright 2007-2009 Technology Shift All Rights Reserved