MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Usage of mask in Easytrieve

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
konakav
Beginner


Joined: 13 Jul 2004
Posts: 12
Topics: 3

PostPosted: Tue Jul 13, 2004 10:51 am    Post subject: Usage of mask in Easytrieve Reply with quote

Hi,

I have a doubt in easytrieve.

i want to display the binary format data in to a specific format.
how to display the binary value using MASK.

for ex (i tried to packed decimal it's working fine) :

packed decimal
Code:
SEQUENCE        W  2   P    MASK('ZZ9-')  HEADING 'RCODE'


Could any one let me know how to use mask for binary data type?
Code:
SEQUENCE        W  4   B    MASK('what is the format here') 


Thanks,
Venu.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Jul 13, 2004 12:07 pm    Post subject: Reply with quote

Konakav,

As far as I know there is no edit mask for binary data items in Easytrieve. If you really want to see the value of binary item, you can move it to another numeric item with edit mask on it.The only mask allowed on a binary item is hex.

For binary numbers, the high-order (left-most) bit is taken as the sign, regardless of field length. In any manipulation, easytrieve shifts the field and propagates the high-order bit. For example, a one-byte binary field containing a hexadecimal FF has the numeric value -1.

Code:

DEFINE W-BINARY  W  04 B 0                   
DEFINE W-NUM     W  09 N 0 MASK('ZZZZZZZZ9-')

W-BINARY = -1                             
W-NUM    = W-BINARY                         
DISPLAY 'THE BINARY NUMBER IS:' W-NUM   


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
konakav
Beginner


Joined: 13 Jul 2004
Posts: 12
Topics: 3

PostPosted: Wed Jul 14, 2004 1:55 am    Post subject: Reply with quote

Hi kolusu,

Thanks for your reply.

I tried with your example but its showing the binary value as 0 in the generated report.

Through file-aid, i observed that the value of binary field is 1.
Can u please tell why its giving like that...

Thanks,
Venu.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Jul 14, 2004 5:13 am    Post subject: Reply with quote

Konakav,

Please post your code.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
konakav
Beginner


Joined: 13 Jul 2004
Posts: 12
Topics: 3

PostPosted: Wed Jul 14, 2004 8:28 am    Post subject: Reply with quote

Please find the below code.

Input file fields:
SEQ 45 4 B

working storage fields:

WSEQ W 4 B
WNUM W 9 N MASK('ZZZZZZZZ9-') VALUE -1 +
HEADING 'ESTSQ'

WNUM = WSEQ

It's working fine but the value it's showing as 0.

reading from input file and moving it to working storage binary varible and then
moving again to numeric filed.
finally displaying numeric field (WNUM).

Thanks for your support,
Venu
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Jul 14, 2004 9:12 am    Post subject: Reply with quote

Konakav,

Quote:

reading from input file and moving it to working storage binary varible and then
moving again to numeric filed. finally displaying numeric field (WNUM).


First thing is you need to define the binary field with 0 decimals which makes it a signed variable.
i.e
Code:

SEQ 45 4 B


Should be defined as
Code:

SEQ 45 4 B 0


Also you don't need a working storage variable for the move. you directly move the input file field to the working storage variable which is defined as NUMERIC.
i.e
Code:

WNUM = SEQ
DISPLAY W-NUM


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
konakav
Beginner


Joined: 13 Jul 2004
Posts: 12
Topics: 3

PostPosted: Wed Jul 14, 2004 10:23 am    Post subject: Reply with quote

Yeah !!! i got it Kolusu.


Thanks a lot
Venu
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group