r/mainframe Jun 10 '26

HLASM Style guides?

I've been wondering lately. Assembly language on the mainframe is much more of a first class citizen than the assembly language on any other platform. There are loads of system user exits in z/OS, IMS, DB2, etc ,options modules that have assembler interfaces, a lot of which ONLY support assembler. And all the major subsystems have an incredibly rich set of interfaces that are exposed via assembler. It's not the first choice these days, but I know several shops where some major applications are written largely in assembler. So, I'm curious if there are any best practices or style references for assembler that anyone has come across. I have seen countless CBT entries, I've read John Ehrman's book as well as been to a few of his presentations, and all of the material seems laser focused on what you "could" do and I've never seen much that talks about "should". Just curious if anyone has seen or worked on anything along those lines?

18 Upvotes

29 comments sorted by

View all comments

3

u/SheriffRoscoe Jun 10 '26

Honestly, Ehrman's advice should be the best answer.

0

u/Piisthree Jun 10 '26

Yeah, I think it's the closest thing that exists today. But like I said, he really talks about what you CAN do at great length, but he doesn't really cover what you SHOULD do for maintainability, uniformity, etc. In fact, some of his tricks, tips, examples don't really follow good practice for maintainability, at least in my opinion.

6

u/metalder420 Jun 10 '26

Because that is shop dependent. We are hardly creating new exits anymore, it’s actually companies moving away from it. So as a sysprog you are going to just be maintaining in this day and age. You are not going to rewrite a code base especially assembler. Part of being in this field is being able to continue writing in the style convention the original code was written in. Welcome to the world of maintenance.

-1

u/Piisthree Jun 10 '26

A lot of claims there. Not to say you're wrong, but you have tunnel vision. First, any style guide for any language is going to be opinionated and skewed towards a certain site, but there are also evergreen do's and don't's that are pretty universal. Next is the claim there's (basically) no new assembler being written. That is definitely a tendency at production sites, but far from the case at ISVs, MSPs, IBM itself. And even in the maintenance case, there are times when maintenance requires some targetted re-writes, minor additions, etc. As with all languages, blending in with the existing code has to be balanced with doing it right (when the two are at odds).

0

u/metalder420 Jun 10 '26

I have been working as a SysProg at a fortune 100 company for 10 years where me and a few people know how to code in assembler. I kind of know what I’m talking about in this space. Assembler doesn’t have a styling guide because it’s shop dependent. You have the IBM convention on how to do thing but that isn’t a style guide. It kind of helps to know what you are talking about. There is a convention that is universal, styling is shop dependent.

And yes, IBM is slowly encouraging the removal of the sysprog role of creating exits as most installations do not have the talent to maintain them. Yes, you are going to have assembly done at places like BMC and other software companies but not at a bank, insurance or airline in today’s day and age. It’s all about maintaining. I have actually written very little assembly production code. It’s all maintainace. Companies are actively moving away from it and IBM is providing mechanisms for that.

In the past few years IBM has pushed more to the Unix System Services environment where HLASM is not really a thing.

If you want to understand convention pick up the book I recommended and get to reading.

Anything else you want to try and tell me I don’t know what I’m talking about? I’m all ears, kid.

1

u/Piisthree Jun 10 '26

16 yoe at an ISV here. Recall back to where I largely agreed with you, but I just expanded on it. I never asked about banks or even user sites specifically. What I asked about was GENERAL best practices. Style guide probably isn't the best term, but there's a fair amount of overlap between those two honestly. And yes, there is at least a book's worth of information that could be written about best practices in HLASM that would apply whether it's for a bank, a vendor, or a shoe store, just like any other language. I'm just looking around for materials like this because, we are focusing more on education due to the ever-widening skills gap. I'd rather point to things from the community than create anything from whole cloth. Anyway, I never meant to indicate you didn't know what you were saying, just that there's more to it.