View previous topic :: View next topic
|
Author |
Message |
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
Hi Robert,
I am very very sorry.
I want to do this with Assembler.
Thanks! |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 -
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/download/DZ9ZS004.pdf?DT=20080216193251&XKS=DZ9ZBK08
Bill |
|
Back to top |
|
|
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
Thank you very much Bill.
I will try this code and will let you know. |
|
Back to top |
|
|
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
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 |
|
|
|