<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Andrew Smithson on Medium]]></title>
        <description><![CDATA[Stories by Andrew Smithson on Medium]]></description>
        <link>https://medium.com/@crshnburn?source=rss-c7b2c318a955------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tLIJVLx2LSymtD5m.jpg</url>
            <title>Stories by Andrew Smithson on Medium</title>
            <link>https://medium.com/@crshnburn?source=rss-c7b2c318a955------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:54:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@crshnburn/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Debugging CICS programs in VS Code]]></title>
            <link>https://medium.com/@crshnburn/debugging-cics-programs-in-vs-code-dc0b6fa8250d?source=rss-c7b2c318a955------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc0b6fa8250d</guid>
            <category><![CDATA[cobol]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[ibm-cics]]></category>
            <category><![CDATA[vscode]]></category>
            <dc:creator><![CDATA[Andrew Smithson]]></dc:creator>
            <pubDate>Tue, 07 May 2024 20:52:46 GMT</pubDate>
            <atom:updated>2024-05-07T20:52:46.815Z</atom:updated>
            <content:encoded><![CDATA[<p>In a recent conference presentation I wanted to be able to show what was happening while a program was running inside my CICS region. While the classic approach of putting log messages out at all the points would show things it lacks some of the interactivity that works well in demos and doesn’t allow you to show what the program is doing at those points.</p><p>Instead using a debugger which allows the use of breakpoints and then inspecting the variables to show what is happening gives a better experience and matches what a developer would see when developing their own applications.</p><p>The rest of this post will be the steps I took to get things up and running.</p><h3>Development and Test System</h3><p>The easiest way to have a mainframe system with all the middleware systems configured along with development tools is to use a Wazi as a Service instance running in IBM Cloud. Following the instructions to get it setup and connected I could connect using a 3270 emulator and SSH.</p><h3>IDE</h3><p>As in the title of this post I’m using VS Code as my IDE, mostly because it is configurable enough to work with any of the languages and systems that I need to use on a day to day basis. There are two key extensions that need to be installed for this piece of work</p><ul><li><a href="https://marketplace.visualstudio.com/items?itemName=IBM.zopeneditor">IBM Z Open Editor</a></li><li><a href="https://marketplace.visualstudio.com/items?itemName=IBM.zopendebug">IBM Z Open Debug</a></li></ul><p>Between them they provide the syntax highlighting and debug integration required to work with a CICS COBOL program.</p><h3>Compiling the application</h3><p>The only change required when compiling the application was to add the TEST(SOURCE) option to the compiler options. This ensures that the source code and compiler listings are included in the compiler object ready for the debugger to use when required.</p><blockquote>Note you should ensure that these are removed for any programs that you are moving into a production environment.</blockquote><h3>Connecting the Debugger</h3><p>To connect to the Debug Server a connection needs to be defined in the Zowe configuration file. I added the following configuration</p><pre>&quot;zOpenDebug&quot;: {<br>   &quot;type&quot;: &quot;zOpenDebug&quot;,<br>   &quot;properties&quot;: {<br>      &quot;host&quot;: &quot;IP Address or Hostname&quot;,<br>      &quot;dpsPort&quot;: 8192,<br>      &quot;dpsContextRoot&quot;: &quot;api/v1&quot;,<br>      &quot;dpsSecured&quot;: true,<br>      &quot;uuid&quot;: &quot;5c35b057-b85f-4a8c-8b45-08f615988e35&quot;,<br>      &quot;user&quot;: &quot;ibmuser&quot;,<br>      &quot;rejectUnauthorized&quot;: false<br>   }<br>}</pre><p>Which then added the connection in the z/OS Debugger Profiles.</p><h3>Configuring the debug profile</h3><p>With the connection to the debug server installed it’s time to define the CICS transaction to be debugged. This was done by right-clicking on CICS in the Debug Profiles tree and selecting ‘Create Debug Profile’.</p><p>In the editor that opens I needed to select the CICS region in which the transaction will run, the name of the transaction and the user who will be running the transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KSjE6NIqoe5O1131l_-5Zw.png" /><figcaption>Debug Profile Editor</figcaption></figure><h3>Debug the program</h3><p>To debug the program the transaction was started from a 3270 terminal at which point it appeared to hang. Going back VS Code in the Debug panel there is the option to connect to a parked session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PdOmzb1WlWWtsZYxi-k7Lg.png" /></figure><p>Running this debug profile connects to the Debug Server and drops us into standard debug view where breakpoints can be set, variables inspected and the code stepped over as required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dabEhou6Lj44elj013SKJg.png" /></figure><h3>Conclusion</h3><p>Using the IBM Z Open Debug extension in VS Code provides the same debug experience as you get for other languages and offers a great way to understand what your code is doing while running.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc0b6fa8250d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using OpenTelemetry in OpenLiberty]]></title>
            <link>https://medium.com/@crshnburn/using-opentelemetry-in-openliberty-7a517421795f?source=rss-c7b2c318a955------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a517421795f</guid>
            <category><![CDATA[opentelemetry]]></category>
            <category><![CDATA[microprofile]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[open-liberty]]></category>
            <dc:creator><![CDATA[Andrew Smithson]]></dc:creator>
            <pubDate>Thu, 15 Dec 2022 16:16:11 GMT</pubDate>
            <atom:updated>2022-12-15T16:16:11.492Z</atom:updated>
            <content:encoded><![CDATA[<p>The <a href="https://openliberty.io/blog/2022/09/01/java-19-22.0.0.10-beta.html">latest betas</a> of the OpenLiberty server have added support for the <a href="https://github.com/eclipse/microprofile-telemetry">MicroProfile Telemetry specification</a> which provides the ability to track the progress of a request through all the parts of your application.</p><p>To start we need an application to instrument so the easiest thing to do is to create a starter application using the <a href="https://openliberty.io/start/">online tool</a>.</p><p>With that downloaded and set-up in an IDE we can start adding the functionality and start seeing what is happening while the service runs.</p><h3>Turning on the functionality</h3><p>Unlike the official specification, the microprofile telemetry specification is not enabled for all applications by default, so in the microprofile-config.properties file needs to have</p><pre>otel.sdk.disabled=false</pre><p>added. We also need to add</p><pre>&lt;feature&gt;mpTelemetry-1.0&lt;/feature&gt;</pre><p>to the server.xml file and now otel records are being produced everytime we call the application.</p><h3>Accessing the records</h3><p>While having the records being produced is great, without a way to access them they’re not adding any benefit to our application.</p><p>Jaeger is an open source product for working with distributed traces which can receive OpenTelemetry records and then display them in a useful way.</p><p>The easiest way to get an instance of Jaeger up and running is to run a container</p><pre>docker run -d --name jaeger \<br>  -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \<br>  -e COLLECTOR_OTLP_ENABLED=true \<br>  -p 6831:6831/udp \<br>  -p 6832:6832/udp \<br>  -p 5778:5778 \<br>  -p 16686:16686 \<br>  -p 4317:4317 \<br>  -p 4318:4318 \<br>  -p 14250:14250 \<br>  -p 14268:14268 \<br>  -p 14269:14269 \<br>  -p 9411:9411 \<br>  jaegertracing/all-in-one:1.40</pre><p>We then need to configure the Liberty server to send the records to the Jaeger instance. This is done with a couple of environment variables</p><pre>OTEL_TRACES_EXPORTER=jaeger<br>OTEL_EXPORTER_JAEGER_ENDPOINT=http://localhost:14250</pre><p>The first says that we’re exporting to a Jaeger endpoint, the second specifies the endpoint the Jaeger service is listening on (which we specified in the docker command).</p><p>Now calling the service results in a record showing up in the UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jcUXEqQ6QDoO5qrq455fLg.png" /><figcaption>Jaeger UI showing an OpenTelemetry trace</figcaption></figure><p>So while we’re now getting the traces being stored, the service name is a bit uninspired and is likely to cause confusion as we start adding more services and applications into the Jaeger server.</p><p>To update the name a new variable can be added to the config properties</p><pre>otel.service.name=HelloWorld</pre><p>Now when traces are exported they show up in the UI under the name we have chosen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXQqp-ywQu7l9g00gE9fmw.png" /><figcaption>Jaeger UI for out now named service traces</figcaption></figure><p>With this all in place we can now add extra instrumentation through attributes, events and child spans to the code and see what is happening in our application and all the services it consumes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a517421795f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accessing z/OS from your Tekton Pipeline]]></title>
            <link>https://medium.com/zowe/accessing-z-os-from-your-tekton-pipeline-4abaffd7110c?source=rss-c7b2c318a955------2</link>
            <guid isPermaLink="false">https://medium.com/p/4abaffd7110c</guid>
            <category><![CDATA[tekton]]></category>
            <category><![CDATA[zowecore]]></category>
            <category><![CDATA[zowe-general]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[mainframe]]></category>
            <dc:creator><![CDATA[Andrew Smithson]]></dc:creator>
            <pubDate>Mon, 25 Jul 2022 13:44:05 GMT</pubDate>
            <atom:updated>2022-11-15T19:57:24.625Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ta4UkDsL2GAoyMX3D9em2g.png" /></figure><p>{<a href="https://github.com/zowe/community/blob/master/blogging/blog_guidelines.md#zowe-core">Core</a>} Having a build pipeline for your projects makes it easy to quickly integrate new features or roll out a bug fix in a repeatable way. Recently I’ve been building pipelines in Tekton as it’s sat really well alongside some other Kubernetes based projects.</p><p>For each of the steps in the pipeline there are a range of Tasks available on the hub but if it turns out there isn’t one it’s pretty straightforward to build your own.</p><p>This is what I had to do when I needed to copy some files from my build to a zFS directory. None of the existing Tasks were the right fit, and having used <a href="https://openmainframeproject.org/">The Open Mainframe Project</a>’s <a href="https://zowe.org/">Zowe</a> CLI before for this type of thing it seemed like a good idea to integrate the two.</p><h3>Building an Image</h3><p>As a Tekton Task runs in a Pod, the first thing to do was to create a container image containing the CLI tooling. This turned out to be a fairly straightforward build file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db651c6fb7764960c61788872dbc908d/href">https://medium.com/media/db651c6fb7764960c61788872dbc908d/href</a></iframe><p>The only configuration required is to turn off the use of secure storage which doesn’t play nicely in a non-interactive environment. This is achieved by putting config in the imperative.json file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cac8b5fce2eb72c5a5cd624aebadfc2e/href">https://medium.com/media/cac8b5fce2eb72c5a5cd624aebadfc2e/href</a></iframe><h3>Creating the Task</h3><p>As a Tekton Task is a Kubernetes native construct it is defined via a yaml file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/652b3a8de20f05d3a71342c265bb4180/href">https://medium.com/media/652b3a8de20f05d3a71342c265bb4180/href</a></iframe><p>This can be installed into the cluster with a ‘kubectl apply -f zowe.yaml’ and then TaskRuns can be created to actually do things.</p><h3>Creating a TaskRun</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/467cd1ee64634738d641d28519826c46/href">https://medium.com/media/467cd1ee64634738d641d28519826c46/href</a></iframe><p>The above TaskRun will list all the currently running jobs. This is specified in the command in the params section. To hold the credentials for accessing the mainframe a Secret is created with the configuration files which is then mounted in at runtime.</p><p>The secret can be created using the following command in the zosmf profiles directory:</p><pre>kubernetes create secret generic zowe-profile \<br>--from-file=profile.yaml=profile.yaml \<br>--from-file=zosmf_meta.yaml=zosmf_meta.yaml</pre><p>Alternatively the configuration could be added as command line parameters.</p><p>With all this in place it’s now possible to integrate Zowe CLI commands into a pipeline and get that automated and repeatable interaction with z/OS.</p><p>If you’re interested in using the Zowe Task then all the source is available here <a href="https://github.com/crshnburn/zowe-tekton">https://github.com/crshnburn/zowe-tekton</a></p><h3>Finding out more</h3><p>If you enjoyed this blog, check out more at the <a href="https://medium.com/zowe">Zowe blogs</a> site. Zowe will also be featured in several sessions at <a href="https://events.linuxfoundation.org/open-mainframe-summit/">Open Mainframe Summit</a>, hosted virtually or in-person in Philadelphia, PA, on September 21–22. Register <a href="https://events.linuxfoundation.org/open-mainframe-summit/register/">here</a>.</p><p>Or, ask a question and join the conversation on the <a href="https://openmainframeproeject.slack.org/">Open Mainframe Project Slack Channel</a> #Zowe-dev, #Zowe-user or #Zowe-onboarding. If this is your first time using the slack channel register <a href="https://slack.openmainframeproject.org/">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4abaffd7110c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zowe/accessing-z-os-from-your-tekton-pipeline-4abaffd7110c">Accessing z/OS from your Tekton Pipeline</a> was originally published in <a href="https://medium.com/zowe">Zowe</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Embed Swagger UI in Github Pages]]></title>
            <link>https://medium.com/@crshnburn/embed-swagger-ui-in-github-pages-9c77a86b2fd2?source=rss-c7b2c318a955------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c77a86b2fd2</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[swagger-ui]]></category>
            <category><![CDATA[swagger]]></category>
            <dc:creator><![CDATA[Andrew Smithson]]></dc:creator>
            <pubDate>Sat, 28 Sep 2019 09:45:11 GMT</pubDate>
            <atom:updated>2019-10-18T14:17:12.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mQDas-nc3B30mGgjcjDR7Q.png" /></figure><p>The Open API Specification gives a standard and easy way to describe RESTful APIs such that anyone can call them or build client applications that use the APIs.</p><p>While the JSON or YAML representations might be great for machines to get done what they need, a graphical interface is definitely preferable for a person who wants to understand what the API can do, and potentially try it out.</p><p>If you’re storing your code and specification in Github, then Github pages gives you a free hosting environment in which to display something like <a href="https://swagger.io/tools/swagger-ui/">Swagger UI</a> which gives potential users that preferable graphical interface.</p><p>The first step is to enable Github Pages on the repo which is documented <a href="https://help.github.com/en/articles/configuring-a-publishing-source-for-github-pages">here</a>.</p><p>Secondly add an index.html page</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bde9342bb7e69d2fc977d25e84067383/href">https://medium.com/media/bde9342bb7e69d2fc977d25e84067383/href</a></iframe><p>Commit and push the changes and in a few seconds your page will be live with the visualisation of your API available to the world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c77a86b2fd2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Develop Zowe CLI in a container]]></title>
            <link>https://medium.com/@crshnburn/develop-zowe-cli-in-a-container-6e05d2ebebfa?source=rss-c7b2c318a955------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e05d2ebebfa</guid>
            <category><![CDATA[zowe]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vscode]]></category>
            <dc:creator><![CDATA[Andrew Smithson]]></dc:creator>
            <pubDate>Tue, 23 Jul 2019 10:20:06 GMT</pubDate>
            <atom:updated>2019-07-23T10:20:06.241Z</atom:updated>
            <content:encoded><![CDATA[<p>While working on a new project I was implementing some build and test function using <a href="https://github.com/zowe/zowe-cli">Zowe CLI</a> to interact with my mainframe, copy files around and submit JCL. While doing this it became clear that the functionality that fitted the workflow wasn’t available, which isn’t a massive problem as it’s an open source project and adding the new function can be done through a bit of development and raising a Pull Request.</p><p>Ok, so far so good, fork the repository and follow the development guidelines, right up until testing involves installing (or linking) the development code globally which then overwrites the stable version that’s used for all my other projects, including a Zowe CLI plug-in.</p><p>How best to proceed without having to keep switching the installed version on my development machine.</p><p>Fortunately Visual Studio Code (which is my current editor of choice) has <a href="https://code.visualstudio.com/docs/remote/remote-overview">added function</a> which allows you to run your development workspace in a container which the graphical interface runs on the host machine. Ok, the ideal situation, now to get it going.</p><p>The instructions for <a href="https://code.visualstudio.com/docs/remote/containers#_getting-started">getting started</a> will do 90% of the work required to get a usable development environment and then it’s just a case of tweaking the configuration in the <em>devcontainer.json</em> file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aaaf9531cefc77f8b539647d882886da/href">https://medium.com/media/aaaf9531cefc77f8b539647d882886da/href</a></iframe><p>The first thing to configure is the extensions that you want running in the project at the start. As well as the typescript extension that the Visual Studio Code template includes, I added Jest support and the Zowe extension to help validate the changes being made to the CLI.</p><p>Secondly I shared my <em>.ssh</em> and <em>.zowe</em> directories into the container as this allowed the container to push commits and branches to GitHub and all the configuration for my mainframe systems was available for trying out my development changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SCXG84GwjO7xgTYOoIIEtQ.png" /><figcaption>Finished development environment</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e05d2ebebfa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BotKit and the Enterprise Grid]]></title>
            <link>https://medium.com/@crshnburn/botkit-and-the-enterprise-grid-b17757791e46?source=rss-c7b2c318a955------2</link>
            <guid isPermaLink="false">https://medium.com/p/b17757791e46</guid>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[slackbot]]></category>
            <category><![CDATA[slack]]></category>
            <dc:creator><![CDATA[Andrew Smithson]]></dc:creator>
            <pubDate>Tue, 09 Jan 2018 23:30:03 GMT</pubDate>
            <atom:updated>2022-11-15T19:55:30.113Z</atom:updated>
            <content:encoded><![CDATA[<p>As part of using Slack at work I created a some bots which listen for patterns and provide links to the resources those items represent. One bot proved popular so that other teams had it installed into their workspaces.</p><p>These teams all got migrated to our Enterprise Grid and the bots continued to work just fine, or so I thought. Coming back from vacation I got a report that sending a DM to the bot ended up with four responses rather than just the expected one.</p><p>Looking at the code, there didn’t appear to be anything coded which would cause this, but it did seem conincidental that the number of responses was equal to the number of teams the bot was installed in.</p><p>Turning to the <a href="https://api.slack.com/enterprise-grid#shared_channels">Slack API documentation</a> they do clearly document that each RTM connection will receive a copy of the message and so using botkit to process those messages will cause the message to processed multiple times leading to the multiple replies.</p><p>Fortunately the ts field on each of these messages is identical so it should be possible to use this in order to only reply once.</p><p>The simplest solution would be to store the ts value of the messages and check whether the value is unknown before sending a response. However this will quickly suck up all the remaining heap so a more intelligent solution is required.</p><p>I found the memory-cache-ttl package which sorted out the heap occupancy issue, by timing out the entries after a defined period.</p><p>A cache is created as a global constant</p><pre>const cache = require(&#39;memory-cache-ttl&#39;);<br>cache.init({ttl: 2, interval: 1, randomize: false});</pre><p>and before processing the message the function needs to check for a cache hit and if there’s a miss then add to the cache and process the message as normal.</p><pre>if (!cache.check(message.ts)) {<br>    cache.add(message.ts, message.ts);<br>    ...<br>}</pre><p>With this in place the bot is a lot less chatty with it’s DM replies and also well equipped to be installed into a shared channel.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b17757791e46" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>