Author Topic: IBM z/OS HLASM modernization  (Read 994 times)

DaveyC

  • Senior Community Member
  • Posts: 164
  • Hero Points: 9
IBM z/OS HLASM modernization
« on: March 09, 2021, 02:41:03 am »
I work for a major z/OS software vendor in the mainframe space and we're currently migrating our source code from legacy data sets to the z/OS UNIX file system and using Git as the SCM. A lot of our development is done in HLASM and a proprietary systems programming language called PL/X. We are looking at IDE's and vscode with language plugins like https://ibm.github.io/zopeneditor-about/ is being considered. As a long time Slickedit user I have thrown Slickedit into the ring and I'm currently working with a development team to run some training. Slickedit has been well received due to it's first class support for mainframe languages and support for MVS data sets in the FTP client.

One issue that has popped up is that we have a requirement to tweak HLASM color coding. In particular continuation lines. It is possible in HLASM using an extension to remove the requirement for continuation characters in column 72. This is an absolute must for our developers if we are to adopt Slickedit as the de-facto editor. We use structure programming macros which turn HLASM into a kind of 2.5 GL.

This is the spec for how continuations are handled.

  • Lines are continued by the LAST comma in the line (1-71) being preceded by a nonblank char and being followed by a blank
  • The comma  that indicates a continuation cannot be within single quotes
  • The continued line can start on any column 2-71

I had a dig around at the hlasm.e macro and it doesn't look like I can do this work myself at it seems to done by the HLASM language parser. It would be much appreciated if I could get some assistance from the SE devs.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5776
  • Hero Points: 461
Re: IBM z/OS HLASM modernization
« Reply #1 on: March 09, 2021, 02:21:35 pm »
Please post some sample code instead of a picture. It will help us verify how this works.

Does this HLASM extension also support the old line continuation method? Just wondering if this new continuation method is a replacement or addition.

DaveyC

  • Senior Community Member
  • Posts: 164
  • Hero Points: 9
Re: IBM z/OS HLASM modernization
« Reply #2 on: March 10, 2021, 12:10:28 am »
Thanks Clark! Yes, old style continuation characters are still supported. The extension is called "flowasm" if you want to use that in a variable name to enable the feature.

I've attached some sample code.

Code: [Select]
HSFPCSCP TITLE 'HSF - PC-cp FOR GENERAL REQUESTS'
         COPY   @GBLC
HSFPCSCP @ENTER BASE=NO_BASE,DATA=(R12),
                BAKR=NO,
                WORKAREA=(R13,R11),
                WORKSP=GLOBAL@PC_POOL,WORKKEY=CALLER,
                PARMREG=R6,
                FIX=
     @COMPID HSFPCSCP
     @STACK INIT
     USING PCRP,R6                  Address it
*--------+---------+---------+---------+---------+---------+---------+-
* Setup skeleton PCRP#PGM
*--------+---------+---------+---------+---------+---------+---------+-
     LAE   R10,WA_PCRP#PGM
     USING PCRP#PGM,R10
     @SETVER PCRP#PGM,LEN=YES
     USING APITRTI,PCRP#PGM_APITRTI
     STCK  APITRTI_INIT
*--------+---------+---------+---------+---------+---------+---------+-
* Setup recovery
*--------+---------+---------+---------+---------+---------+---------+-
     @RECOVER ON,RETRY=RECOVERY,      comment lines 1
              MODE=ARR,               comment line with a comma,
              MSGLEVEL==AL1(0),
              LOGREC==C'Y',
              DUMP==C'Y',
              EXIT==V(HSFRCNMX),
              REGS=(R10,R11,R12,R13)

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5776
  • Hero Points: 461
Re: IBM z/OS HLASM modernization
« Reply #3 on: March 10, 2021, 12:26:12 am »
Thanks. Would it make sense for this extension to be on by default? It seems like the source won't compile anyway if the user isn't using the extension. I would think a trailing comma means there has to be some sort of continuation code (new way or old way).

DaveyC

  • Senior Community Member
  • Posts: 164
  • Hero Points: 9
Re: IBM z/OS HLASM modernization
« Reply #4 on: March 10, 2021, 09:36:42 am »
I wouldn't make it the default as it needs to be explicitly specified as an assembler option. Customers that don't use the extension will experience unwanted behavior. I'm sorry if this makes the implementation more work for you.

For more context on this requirement see https://blog.rocketsoftware.com/2019/11/modern-assembler-programming-z-os/. I'm working with the author of that blog who is one of our DEs to onboard the teams to SE.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5776
  • Hero Points: 461
Re: IBM z/OS HLASM modernization
« Reply #5 on: March 10, 2021, 03:53:52 pm »
We would add an option anyway. I just wondered about the default. Thanks

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5776
  • Hero Points: 461
Re: IBM z/OS HLASM modernization
« Reply #6 on: March 10, 2021, 10:44:14 pm »
I've created a 25.0.1 installer with flowasm support for you to test.

You can download it here:
https://support.slickedit.com/outbound/2501/se_25000100_win64-flowasm.msi

To turn on the feature, go to Tools>Options>Languages>Assembly Languages>IBM HLASM>Color Coding>Languages Tab>IBM HLASM flowasm" and turn this check box on.

Let me know if this does what you need.

DaveyC

  • Senior Community Member
  • Posts: 164
  • Hero Points: 9
Re: IBM z/OS HLASM modernization
« Reply #7 on: March 11, 2021, 12:49:46 am »
Almost perfect. Another restriction that FLOWASM eliminates is the requirement for continued lines to start in column 16. They can start in any column from 2 - 71. I didn't mention that in the spec. Sorry about that!

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5776
  • Hero Points: 461
Re: IBM z/OS HLASM modernization
« Reply #8 on: March 11, 2021, 02:42:06 am »
Simple change. I've updated the installer at the above link. Let me Know if there are any more tweaks needed.

DaveyC

  • Senior Community Member
  • Posts: 164
  • Hero Points: 9
Re: IBM z/OS HLASM modernization
« Reply #9 on: March 11, 2021, 04:11:23 am »
Bingo! Nailed it! This is awesome - thanks for churning this out so quickly. Slickedit is now the only editor to support this feature including ISPF which is functionally stabilized and supported by one guy at IBM Raleigh, your old stomping ground I believe?

Incidentally, we found that Slickedit has pretty good support for PL/X just by creating a profile based on PL/1 and adding some keywords.

DaveyC

  • Senior Community Member
  • Posts: 164
  • Hero Points: 9
Re: IBM z/OS HLASM modernization
« Reply #10 on: March 11, 2021, 05:38:05 am »
Spotted a couple of problems. Comma's preceded by a space are not continuations. It's a common idiom in HLASM to use a " ," after a single keyword line to trick the ISPF editor to correctly highlight comments. Also, continuation lines that begin in columns after 20 are being treated as comments.

Code: [Select]
     DO ,                              <- not a continuation
       @CALL EP==V(HSFPCSCI),PARAM=(PCRP,PCRP#PGM),TRACE=NO
       DOEXIT (LTR,R15,R15,NZ)
       STCK  APITRTI_UCON
       LLGT  R8,PCRP#PGM_RXCT
       USING RXCT,R8
       IF (TM,RXCT_FLG1,RXCT@FLG1_DEBUG,O)
         @RECOVER EDIT,MSGLEVEL==AL1(1)
       ENDIF
       USING APIHDR,PCRP#PGM_APIHDR
       USING APISYS,APIHDR_APISYS
       @TRACE REQ=SET,ANCHOR=PCRP#PGM_TRCECNTL
       USING APITRRI,PCRP#PGM_APITRRI
*--------+---------+---------+---------+---------+---------+---------+-
* Which service is required ?
*--------+---------+---------+---------+---------+---------+---------+-
       SELECT CLI,PCRP_REQ,EQ
         WHEN (PCRP@REQ_ACTION)
*--------+---------+---------+---------+---------+---------+---------+-
* ..Action services
*
*--------+---------+---------+---------+---------+---------+---------+-
           SELECT CLC,PCRP_TYPE,EQ
             WHEN (=CL8'APIACTN',=CL8'RESTORE')
               @CALL EP==V(HSFPCSAC),PARAM=WA_PCRP#PGM,AMODE=64,
                    RETCODE=APITRRI_RC,RSNCODE=APITRRI_RSN <- not a comment
             WHEN (=CL8'INTAPI')
               @CALL EP==V(HSFPCSAI),PARAM=WA_PCRP#PGM,AMODE=64,
                     RETCODE=APITRRI_RC,RSNCODE=APITRRI_RSN
             WHEN (=CL8'ISFREQ')
               @CALL PROC=ACTION_ISFREQ,
                    RETCODE=APITRRI_RC,RSNCODE=APITRRI_RSN
             OTHRWISE
               @RC   APITRRI_RC,SEV=ERROR
               @RC   APITRRI_RSN,RC=RC@BAD_OPTION
           ENDSEL
         WHEN (PCRP@REQ_AUTHSAF)
*--------+---------+---------+---------+---------+---------+---------+-
* ..Auth services (SDSF key callers only)
*--------+---------+---------+---------+---------+---------+---------+-
           @RC   APITRRI_RC,SEV=ERROR
           @RC   APITRRI_RSN,RC=RC@BAD_KEY
           LLGT  R0,WA_CALLER_KEY      Key = 000000k0
           SRL   R0,4                  Key = 0000000k
           IF (CLM,R0,B'0001',EQ,=AL1(GLOBAL@KEY))
             @CALL EP==V(HSFPCSAS),PARAM=WA_PCRP#PGM,
                   RETCODE=APITRRI_RC,RSNCODE=APITRRI_RSN
           ENDIF
         WHEN (PCRP@REQ_CLEANUP)
« Last Edit: March 11, 2021, 06:09:53 am by DaveyC »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5776
  • Hero Points: 461
Re: IBM z/OS HLASM modernization
« Reply #11 on: March 11, 2021, 07:49:06 am »
When "flowasm" is turned on, what happens if there is a character in column 71? With the old line continuation method, that would cause various continuations. Is this disabled in "flowasm" mode?
« Last Edit: March 11, 2021, 07:52:26 am by Clark »

DaveyC

  • Senior Community Member
  • Posts: 164
  • Hero Points: 9
Re: IBM z/OS HLASM modernization
« Reply #12 on: March 11, 2021, 10:57:20 am »
Yes, continuation characters in column 71 are disabled.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5776
  • Hero Points: 461
Re: IBM z/OS HLASM modernization
« Reply #13 on: March 11, 2021, 02:22:09 pm »
 I've updated the installer at the above link. Let me Know if there are any more tweaks needed.

DaveyC

  • Senior Community Member
  • Posts: 164
  • Hero Points: 9
Re: IBM z/OS HLASM modernization
« Reply #14 on: March 12, 2021, 07:34:09 am »
Cooking with gas.