As previously suggested, I think the following code will do it in a simpler way:
SLR R11,R11
ICM R11,B'0011',SMF118TRP
CVD R11,DWORD
UNPK OUTTRP,DWORD+5
OI OUTTRP+4,X'F0'
.
DWORD DS D
OUTTRP DS CL5
Jose Flores
Sr. Mainframe Developer
GT Software Inc.
-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On
Behalf Of Alan Atkinson
Sent: Monday, October 26, 2015 10:19 AM
To: [email protected]
Subject: Re: Displaying port nr in decimal
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 [[email protected]] on behalf
of Elardus Engelbrecht [[email protected]]
Sent: Monday, October 26, 2015 10:14 AM
To: [email protected]
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