Can't you just cvd, oi the last byte with x'0f' and unpack(5). 
Or are you looking for something more sophisticated where you trim leading 
zeros and left align?

 
________________________________________
From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf 
of Elardus Engelbrecht [elardus.engelbre...@sita.co.za]
Sent: Monday, October 26, 2015 10:14 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Displaying port nr in decimal

To all,

My oh my, I can't believe my Assembler skills are that rusty!

But here is the challenge. With this snippet, I could show the Remote Port from 
SMF record type 118 in decimal.

I'm feeling my code, while working as designed, is not that optimal, especially 
usage of R11, Double Word and too long edit field.

         SLR   R11,R11                  CLEAR
         MVC   DWORD,R11                CLEAR DWORD
         MVC   DWORD+2(2),SMF118TRP    .MOVE PORT
         L     R11,DWORD               .
         CVD   R11,DWORD               .CONVERT TO DECIMAL
         MVC   EDWORK2,EDMASK2
         ED    EDWORK2,DWORD+2
         MVC   OUTTRP,EDWORK2          .MOVE REMOTE PORT
*
DWORD    DS    D
EDWORK2  DC    XL12'00'
EDMASK2  DC    XL12'202020202020202020202020'
*
OUTTRP   DS    XL12                   .REMOTE PORT NUMBER
*
SMF118TRP DS   XL2                    .REMOTE PORT NUMBER

This is the display I got, but as you can see, I'm wasting bytes in the output. 
I want to trim the output from 12 bytes to 5 columns (max port nr is 65535).

REMOTE PORT
DCDDEC4DDDE
95463507693
------------
       1218
2222222FFFF2
000000012180

Is there a more elegant way to do above? (z/OS v1.13 and v2.1)

Perhaps with CVD and UNPK and OI instructions?

Please and many thanks on advance.

Groete / Greetings
Elardus Engelbrecht

Reply via email to