Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How do I coding assembly code for hex data calculate.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Mansik Kim

New User


Joined: 15 Dec 2006
Posts: 29
Location: Korea

PostPosted: Fri Dec 27, 2013 7:23 am    Post subject: How do I coding assembly code for hex data calculate.
Reply with quote

Hi All,

I am working SMF read program in assembly.

There was changed hex data length from 4 byte to 8 byte.

So, I need to change my program code for calculate logic.

Please let me have a good samples.

The following code is current and changed code.

Thanks,
Mansik.

========================================
The current program code
========================================
Code:
**********************************************************************
*       SMF DATA READ (FIRST READ)
**********************************************************************
        GET       OF1101                 /* SMF RECORDS
        LR        R6,R1                  /*  R1   ===> R6
        MVC       OR1101(256),0(R6)
*
LOOP1   L         R3,DISPT
            CVD       R3,DX
            AP        DISPT1,DX
*
SKIP4  GET       OF1101                 /* SMF RECORDS
           LR        R6,R1                  /*  R1   ===> R6
*
           MVC       OR1101(256),0(R6)
*
           B         LOOP1
*
DISPT   DS        CL4
*
DISPT1  DC        XL8'000000000000000C'
*
DX        DC        XL8'000000000000000C'
**********************************************************************
*       SMF1101 INPUT AREA DEFINE
**********************************************************************
        DS       0D
OR1101  DS       0CL256
        ..
        ..
DISPT   DS        CL4
        ..
        ..
*

==============================================
The changed (DISPT Length 4 byte ==> 8 byte)
==============================================
Code:
DISPT   DS        CL4
===>
DISPT   DS        CL8


Code'd
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Dec 27, 2013 3:54 pm    Post subject: Reply to: How do I coding assembly code for hex data calcula
Reply with quote

What's the hex-format of the date? Please provide an example and then we'll go from there.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Fri Dec 27, 2013 4:25 pm    Post subject:
Reply with quote

Bill, the date in SMF is always PL4'0cyyddd' The sign is usually X'F'.

In the last couple of years I've written a lot of Assembler code to read SMF data, but I don't have a clue what the TS is trying to accomplish. The MVC OR1101,0(R6) is likely going to get random S0C4s. If the revised DISPT is supposed to represent the SMF record time and date rather than the date the code is going to get S0C7s as the time is binary time of day in 1/100th seconds. It appears the TS has no clue how to process SMF data.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Fri Dec 27, 2013 5:07 pm    Post subject:
Reply with quote

This is more correct. Notice the only arithmetic is compares.
Code:
SMFREC   DSECT                     DEFINE A GENERIC SMF RECORD
SMFRECL  DS    2AL2                RECORD LENGTH IN THE RDW   
         DS    BL1                 FLAGS                     
SMFRTYPE DS    AL1                 RECORD TYPE               
SMFRTME  DS    XL4                 RECORD TIME               
SMFRDTE  DS    XL4                 RECORD DATE               

LOOP     GET   SMFDCB
         LR    6,1
         USING SMFREC,6
         CLI   SMFRTYPE,2
         BE    LOOP
         CLI   SMFRTYPE,3
         BE    LOOP
         CP    SMFRDTE,LOWDATE
         BL    NEWLOW
         BH    NOTLOW
         ICM   0,B'1111',SMFRTME
         C     0,LOWTIME
         BNL   NOTLOW
NEWLOW   MVC   LOWDATE,SMFRDTE
         MVC   LOWTIME,SMFRTME
NOTLOW   ...
         B     LOOP
         ...
SMFDCB   DCB   DSORG=PS,MACRF=GL,BFTEK=A,...
LOWTIME  DC    0F'0',X'7FFFFFFF'
LOWDATE  DC    PL4'999365'
The code ignores record types 2 and 3; those records are written by IFASMFDP and do not represent data. I use ICM to load the record time of day into reg 0 because the field is not aligned and this code does not cause an Assembler warning message. LOWDATE and LOWTIME are set very high to make sure the first record will set them with a "real" date and time.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Dec 27, 2013 5:28 pm    Post subject: Reply to: How do I coding assembly code for hex data calcula
Reply with quote

Steve,

I wasn't 100% sure of the date-format and this is why I had asked.

I'm still hoping the TS will post the new 8-Byte format, (rather than taking a SWAG), so that we'll know for sure, even though it's in an SMF record.

Requests such as this have a tendency to completely change. icon_eek.gif

All we can do now is wait.

But, after re-reading the post, I have a question for the TS - IS THIS A DATE OR DATA?

Please advise....
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Dec 27, 2013 8:14 pm    Post subject: Reply to: How do I coding assembly code for hex data calcula
Reply with quote

Let's assume at 0(R6), there's 8-Bytes of valid hex-data, which we need to convert to packed-decimal -

Code:

QWORD    DS    L                       QUADWORD-AREA                   
DWORD    DS    D                       DBLWORD-AREA                     
*                                                                       
         MVC   DWORD,0(R6)             POPULATE DBLWORD                 
         LG    R15,DWORD               LOAD GRANDE R15                 
         CVDG  R15,QWORD               MAKE IT 16-BYTES PACKED-DECIMAL                   

At this point QWORD (effectively, a PL16) contains the 16-Byte Packed-Decimal equvilent of the 8 Hex-Bytes which were found at 0(R6).

HTH....
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Sat Dec 28, 2013 1:34 am    Post subject:
Reply with quote

Bill, actually I think this is what you want.
Code:
         TR    QWORD,UNHEXTAB
         PACK  DWORD(5),QWORD(9)   
         PACK  DWORD+4(5),QWORD+8(9)

UNHEXTAB DC    (C'A')X'00',X'0A0B0C0D0E0F'
         DC    (C'0'-(*-UNHEXTAB))X'00',X'00010203040506070809'
         DC    (256-(*-UNHEXTAB))X'00'
QWORD    DC    C'0123456789ABCDEF',C' '
DWORD    DC    XL8'00',X'00'
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Dec 28, 2013 2:08 am    Post subject: Reply to: How do I coding assembly code for hex data calcula
Reply with quote

Steve,

I'm not sure what the TS wants, so I took a SWAG, because I still don't know if it's a DATE or DATA he's after and whether he needs to convert the 8-Bytes of Hex into 16-Bytes of Character or convert the 8-Bytes to Packed-Decimal.

I guess our replies are not that critical because I haven't heard from the TS.

The drama continues.... icon_eek.gif
Back to top
View user's profile Send private message
Mansik Kim

New User


Joined: 15 Dec 2006
Posts: 29
Location: Korea

PostPosted: Sat Dec 28, 2013 9:20 am    Post subject: Just hex data 8 byte add calculation.
Reply with quote

Hi all,

I was already have a SMF read program.
I can read SMF data from assembly include date, time format.

I want to know that 8 byte hex data addition calculate method.

Please let me have a good samples.

Thanks,
Mansik.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Sat Dec 28, 2013 9:32 am    Post subject: Re: Just hex data 8 byte add calculation.
Reply with quote

Mansik Kim wrote:
... I want to know that 8 byte hex data addition calculate method.
You will have to be more specific. Doing arithmetic on date and times is fairly difficult. Believe me, I speak from experience.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Dec 29, 2013 10:20 pm    Post subject:
Reply with quote

Hello,

You might consider writing the data arithmetic operations in a COBOL module and then invoke it. COBOL has far more tools to work with dates than does assembler.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Dec 30, 2013 4:42 am    Post subject: Reply to: How do I coding assembly code for hex data calcula
Reply with quote

we are getting nowhere
data/date misunderstanding ...
the TS talks about 8 bytes hex data, but the coded samples show 8 bytes PACKED data
???
best thing would be for the TS to tell the SMF record type and the field/variable name
that he is trying to process
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Mon Dec 30, 2013 6:58 am    Post subject:
Reply with quote

Enrico - I agree. If the little sample he gave us is any indication of his real code, he has lots of problems. About the only thing he gave us that is correct is the GET macro - assuming the DCB specifies MACRF=GL,BFTEK=A, which he did not show us.

Spring 2013 I think it was I wrote code to compute elapsed time given an SMF record time and a start time in SMF time of day and date format. The code works, but it is very rough - not something I'd share. I just wrote the equivalent as a closed subroutine, but as I write this it's not working, and even when I get it to work I'm not sure I'd want to share it.
Back to top
View user's profile Send private message
Mansik Kim

New User


Joined: 15 Dec 2006
Posts: 29
Location: Korea

PostPosted: Mon Dec 30, 2013 7:07 am    Post subject: Re: Reply to: How do I coding assembly code for hex data cal
Reply with quote

Code:
QWORD    DS    L                       QUADWORD-AREA                   
DWORD    DS    D                       DBLWORD-AREA                     
*                                                                       
         MVC   DWORD,0(R6)             POPULATE DBLWORD                 
         LG    R15,DWORD               LOAD GRANDE R15                 
         CVDG  R15,QWORD               MAKE IT 16-BYTES PACKED-DECIMAL

Hi Bill,

Thanks for your reply.

How can I have reference manial about "LG" and "CVDG".

I can't find that.

Please let me know.

Thanks,
Mansik.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Dec 30, 2013 7:26 am    Post subject: Reply to: How do I coding assembly code for hex data calcula
Reply with quote

Mansik,

LG and CVDG are two of the many 64-Bit instructions (known as Grande), introduced with HLASM and POPS well over 10 years ago.

The z/OS Principles of Operation manual (The Bible for Assembler programmers) defines these instructions and many others, extensively.

z/OS 1.13 POPS Manual (PDF format) -

http://publibfi.boulder.ibm.com/epubs/pdf/dz9zr008.pdf

It's around 35MB, so if you have a slow connection, begin the download and go get some breakfast icon_smile.gif

You can also Google these instructions as well....

HTH....
Back to top
View user's profile Send private message
Mansik Kim

New User


Joined: 15 Dec 2006
Posts: 29
Location: Korea

PostPosted: Mon Dec 30, 2013 9:14 am    Post subject: Reply to: How do I coding assembly code for hex data calcula
Reply with quote

Hi Bill,

Thank you for your answer.

I got you upload manual and I try it.

Thanks,
Mansik.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Mon Dec 30, 2013 12:01 pm    Post subject:
Reply with quote

Bill: the topic starter is leading you down a false trail. The topic starter seems to be convinced the 8 byte data area defined by SMFRTME and SMFRDTE in my first post in this thread is an 8 byte packed decimal data area. This is not true. The first 4 bytes are binary data that represents the time of day in 1/100th of a second from midnight. The second 4 bytes are a date, as a packed decimal number with digits containing PL4'0cyyddd' where c is a century indicator, 0 for 1900 through 1999, and 1 for 2000 through 2099, yy is the year in the century, and ddd is the day of the year, from 001 through 365 or 366 in leap years.

Performing LG/CVDG will work, but the result of the CVDG, for all intents and purposes, will be garbage.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Dec 30, 2013 4:30 pm    Post subject:
Reply with quote

Bill, Steve I didn't see the TS talking about DATE but about DATA.
Even the titel of this topic is : How do I coding assembly code for hex DATA calculation.

In his poor coding example even the the DISPT field is hanging around.

So before you put any effort in this crappy topic, the TS has to do better with explaining which fields from what SMF records he/she wants to process.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Mon Dec 30, 2013 5:03 pm    Post subject:
Reply with quote

Peter. Agreed. I'm not going to comment any more until this Mansik Kim defines his input correctly.
Back to top
View user's profile Send private message
Mansik Kim

New User


Joined: 15 Dec 2006
Posts: 29
Location: Korea

PostPosted: Thu Jan 02, 2014 6:18 pm    Post subject: Reply to: How do I coding assembly code for hex data calcula
Reply with quote

Hi Bill,

I did completed asembly code and SMF data read test successfull.

Thank you for your answer.

Mansik.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Unwrap the data based on delimiter X'25' bhavana yalavarthi DFSORT/ICETOOL 30 Fri Dec 09, 2016 10:25 am
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us