Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Compare first byte higher nibble of two character fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 161
Location: India

PostPosted: Thu May 20, 2010 5:24 pm    Post subject: Compare first byte higher nibble of two character fields
Reply with quote

Hi,

I want to compare first byte higher nibble of two character fields.

Could you please suggest me which instruction I can use for this?

Thanks in advance.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8210
Location: Dubuque, Iowa, USA

PostPosted: Thu May 20, 2010 5:43 pm    Post subject:
Reply with quote

Quote:
Could you please suggest me which instruction I can use for this?
Could you please suggest us which LANGUAGE you're planning on using for this?
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 161
Location: India

PostPosted: Thu May 20, 2010 6:02 pm    Post subject:
Reply with quote

Hi Robert,

I am very very sorry.

I want to do this with Assembler.

Thanks!
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Thu May 20, 2010 6:05 pm    Post subject: Reply to: Compare first byte higher nibble of two character
Reply with quote

Try this -

Code:

WORKAREA DS    CL2
CHARAREA DS    CL2
*
         XC    WORKAREA,WORKAREA       ENSURE X'00'S
         MVZ   WORKAREA,CHARAREA       MOVE ZONES ONLY
         CLC   WORKAREA+1(1),WORKAREA  ARE THEY EQUAL?
         BNE   NOTEQUAL                NO, BRANCH ACCORDINGLY

This is just one of multiple ways of doing this....

Bill
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 161
Location: India

PostPosted: Thu May 20, 2010 6:13 pm    Post subject:
Reply with quote

Hi Bill,

I understand below two statements how they works.

Code:

         XC    WORKAREA,WORKAREA       ENSURE X'00'S
         MVZ   WORKAREA,CHARAREA       MOVE ZONES ONLY


Can you explain me the execution with an example please?

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

CICS Moderator


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

PostPosted: Thu May 20, 2010 6:25 pm    Post subject: Reply to: Compare first byte higher nibble of two character
Reply with quote

The MVZ moves each of the high-order nibbles (zones) from the two-bytes defined to CHARAREA, into WORKAREA.

After clearing WORKAREA to X'00's and issuing the MVZ, WORKAREA(1) could equal (for example), X'C0' and WORKAREA+1(1) could equal (for example), X'D0'.

Then, after the CLC (effectively comparing the high-order nibbles of these two bytes because the low-order nibbles are B'0000'), you'll get an EQUAL or NOT EQUAL condition-code.

z/Architecture Reference Summary -

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/download/DZ9ZS004.pdf?DT=20080216193251&XKS=DZ9ZBK08

Bill
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 161
Location: India

PostPosted: Thu May 20, 2010 6:57 pm    Post subject:
Reply with quote

Thank you very much Bill.

I will try this code and will let you know.
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 161
Location: India

PostPosted: Wed May 26, 2010 11:55 am    Post subject:
Reply with quote

Hi,

I have modified my code as per your suggestion. I am getting error at compilation.

My code:

Code:

TMPAGT   DC    CL5'A1234'
INAGENT  DC    CL5'98564'

INAGT1   DC    CL1'0'
TMPAGT1  DC    CL1'0'

          XC    INAGT1,INAGT1
          XC    TMPAGT1,TMPAGT1
          MVZ   INAGT1,INAGENT(1)
          MVZ   TMPAGT1,TMPAGT(1)



I am getting following error message

Code:

000116 0000 0000 0000 00000 00000   121          MVZ   INAGT1,INAGENT(1)
** ASMA173S Delimiter error, expected blank - (1)
** ASMA435I Record 74 in MYID.HLQ2.SOURCE(QSX0780) on volume: IAS791
00011C 0000 0000 0000 00000 00000   122          MVZ   TMPAGT1,TMPAGT(1)
** ASMA173S Delimiter error, expected blank - (1)
** ASMA435I Record 75 in MYID.HLQ2.SOURCE(QSX0780) on volume: IAS791


Could you please tell me why this error is coming?

My intension here is I want to move one byte zone values to INAGT1, TMPAGT1 form INAGENT, TMPAGT respectively.

Thanks in advance!
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10387
Location: italy

PostPosted: Wed May 26, 2010 12:07 pm    Post subject: Reply to: Compare first byte higher nibble of two character
Reply with quote

You did not follow Bill' s suggestions

the mvz instruction uses the lenght of the first operand
so putting an explicit length on the second operand will cause assembler
to complain
-- (1) could be an explicit length or a register ref, anyway it should not be there

You could have found out by looking at the manuals

http://publib.boulder.ibm.com/infocenter/wdzinfo/v7r0/index.jsp?topic=/com.ibm.ent.asm.zos.doc/topics/fn1pgmst333.htm

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dz9zr003/7.5.96?ACTION=MATCHES&REQUEST=MVZ&TYPE=FUZZY&SHELF=DZ9ZBK03&DT=20040504121320&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT
but naturally You were too ..... to look for it Yourself


googling for the message ASMA173S or for IBM MVZ POP
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 161
Location: India

PostPosted: Wed May 26, 2010 12:29 pm    Post subject:
Reply with quote

Hi,

Thank you very much for your quick reply. My code is working fine with the below change.

Code:
MVZ   INAGT1(1),INAGENT
MVZ   TMPAGT1(1),TMPAGT


Thank you very much once again!
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sum the fields in particular format f... sharana64 DFSORT/ICETOOL 9 Fri Jan 05, 2018 1:11 am
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us