In the first few weeks from joining the company, I created three ISPF Edit macros and presented this to the team. I did a demonstration and shared the code. I was hoping it will influence the team towards the automation route (similar to what I did with the previous teams I work with).
I thought that my strategy did not work as months passed with nothing happening. But everything changed today.
One of the application developers went up to me for some advice. He is currently working on a new branch being created in the system and was assigned to generate all of the datasets needed for all environments.
The entities needed in the file creation process already exists but needed to be customised. This means copying all of the jobs and control cards used in the last branch setup and updating certain strings within each entity to the values associated with the new branch.
It is a simple job that can be achieved by ISPF Edit commands. The only issue with this is that he is dealing with more than five hundred files and at least six development environments. Editing more than three thousand entities is very tedious and prone to errors. Nobody in his right mind should do this.
With this, he remembered my talk about automation back in January and was hoping if I could help him out.
Before I gave my response, I asked him to show me how he would do it manually. First, he open a member to edit it. He then applied some filters using Exclude all ISPF edit command to isolate those lines to be updated. Lastly, he executed a series of Change all Edit commands to apply the updates needed.
Based on what I saw, it is a good candidate for an ISPF Edit macro automation. The steps are defined and can easily be translated to executable calls in REXX.
To create the macro, we started with a basic template in REXX shown below.
000001 /*REXX*/
000002 address isredit "macro"
000003 <insert commands here>
000004 exit 0
Now all we need to do is insert the commands specific for the task. Using the manual steps I was shown previously, we proceeded in translating this commands to REXX calls. This is done by concatenating the address isredit text to the commands entered in the command line. So an exclude command below:
EXCLUDE DSN ALL
will appear as
address isredit "EXCLUDE DSN ALL"
in the Edit macro.
A few more lines (less than ten) and the automation tool is finished. We tried it in one entity and it worked as expected.
He was too eager to use the macro that he started editing the other members in the library. I stopped him from doing so because we can do so much more. From my point of view, the tool is not complete.
I suggested that he does not need to manually go through each member as this step can also be automated. We can to create a REXX executable that lists all members in the library, goes through each member in the list and executes the macro to do the update.
Another thirty minutes to create the additional REXX executable and we are done. We tested it and it ran for three minutes to update all members in the library. By doing this, we have completed a task estimated for two days in less than three hours (less if you only consider the actual development time, taking away the time spent in mentoring). Best of all, this tool is available the next time a new branch is setup.
After that, he is hooked. He came up with the same conclusion as I had before - "This is the way forward". Now, he is taking his new tool a bit further by providing a user interface to make it easier to use. From the looks of it, he will be finished before the week ends.
From experience, I have encountered many similar tasks that can be solve by a simple ISPF Edit macro. You may have one in mind right now and I maybe able to help you out. If you are interested, just contact me.

0 comments:
Post a Comment