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 

Signed Variables 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
Meg
Beginner


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Mon Mar 08, 2004 7:38 am    Post subject: Signed Variables in Easytrieve Reply with quote

Hi All,
Would like to know if the packed number declared in an easytrive program takes sign to be default.
To make it clear, a variable declared in cobol as 9(1) comp-3 will be declared in an easytrieve program as
VAR1 01 01 P
Does VAR1 have a signed bit as default and does it mean VAR1 is equivalent to S9(1) comp-3?

Also, it looks like when we do a move in easytrieve, say,
MOVE VAR1 to VAR2 where VAR1 and VAR2 are packed variables and VAR2 is equal to 1, the HEX value of VAR1 is 1C while when we say,
VAR1 = VAR2 and VAR2 is 1
VAR1 has a hex value of 1F.
Can anyone let me know why this is happening?
Thanks,
Megana
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Mar 08, 2004 8:18 am    Post subject: Reply with quote

Megana,

If you specify a numeric field with decimal positions (0 to 18 ), it is considered to be a signed (quantitative) field..If you specify a numeric field with no decimal positions, that field is considered to be unsigned (non-quantitative)

An unsigned packed decimal field (U format) is always unsigned. When you manipulate the field, an F sign is supplied.

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
Meg
Beginner


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Wed Mar 10, 2004 12:20 am    Post subject: Reply with quote

Hi Kolusu,
Quote:
"When you manipulate the field, an F sign is supplied. "

I am not able to understand what manipulate means here. Also I guess this is only for unsigned packed decimal field (U format) right? If it is so then why does the P format get a F when we do VAR1 = VAR2.
Also VAR1 when declared as VAR1 01 01 P does not have any decimal point right or does it take default as 0?

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


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

PostPosted: Wed Mar 10, 2004 6:37 am    Post subject: Reply with quote

Meghana,

Manipulation meant when you do a calculation(addition , subtraction...) . This is different from a Move.

When you say VAR1 = VAR2 the compiler interprets as if you are manipulating the data(addition of var2 with zero) and provides the 'F' sign.

But when you say move var2 to var1 then you are overlaying the contents of var2 onto var1.


Quote:

Also VAR1 when declared as VAR1 01 01 P does not have any decimal point right or does it take default as 0?


There is no decimal point and it does not take 0 as default. The decimal point declaration not only specifies the decimal position but it also specifies the sign.

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
Meg
Beginner


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Wed Mar 10, 2004 7:29 am    Post subject: Reply with quote

Thanks Kolusu, I got it finally. Very Happy
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