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 

Conversion

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


Joined: 01 Jun 2004
Posts: 10
Topics: 1

PostPosted: Thu Jul 22, 2004 4:12 am    Post subject: Conversion Reply with quote

I am a little confused with the following scenario

VAR1 : Defined as pic 9(3) Contains low-values (x'000000')
VAR2 : Defined as pic 9(3) contains 0 (x'F0F0F0).

IF VAR1 = ZEROES
( This statement is evaluated as false)

If Var1 = Var2
(This satement is evaluated as true)

Can someone tell me what I am missing here ?

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


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

PostPosted: Thu Jul 22, 2004 4:30 am    Post subject: Reply with quote

dhruv,

how did you populate Low-values to var-1? I don' t think you can have low-values for a numeric integer.

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


Joined: 01 Jun 2004
Posts: 10
Topics: 1

PostPosted: Thu Jul 22, 2004 4:33 am    Post subject: Reply with quote

Assigned low-values through group level move

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


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

PostPosted: Thu Jul 22, 2004 4:39 am    Post subject: Reply with quote

dhruv,

Please show me your defnition and move statement. I expect a S0C7 abend.

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


Joined: 01 Jun 2004
Posts: 10
Topics: 1

PostPosted: Thu Jul 22, 2004 4:54 am    Post subject: Reply with quote

There is no SOC7 abend. I am a little surprised that you expect one.

Anyway, what about the following scenario

VAR1 PIC 9(3) .
VAR1_RDF REDEFINES VAR1 PIC X(3).

MOVE LOW-VALUES TO VAR1_RDF

You will not receive a SOC7

In my particular case, its more like this

01 GROUP.
03 FILLER PIC X(1)
...
...
03 VAR1 PIC 9(3).


MOVE LOW_VALUES TO GROUP
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jul 22, 2004 5:05 am    Post subject: Reply with quote

dhruv,

I agree that with redefines you will not encounter S0C7 abend. But with a group you will definitely encounter a S0C7 unless there is a redefine.

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


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Thu Jul 22, 2004 5:23 am    Post subject: Reply with quote

Just going back to the orignal point:
low-values is not regarded as zero in a 9(3) display field (or a packed or floating point field). It is an invalid value. low-values is only regarded as zero in binary field.
Back to top
View user's profile Send private message
dhruv
Beginner


Joined: 01 Jun 2004
Posts: 10
Topics: 1

PostPosted: Thu Jul 22, 2004 6:06 am    Post subject: Reply with quote

I agree that low-values are binary zeroes.

So If VAR1 = ZEROES (VAR1 = x'000000')
being evluated as false is correct.

But then, why is the statement

IF VAR1 = VAR2 (VAR1 = x'000000' , VAR2 = x'F0F0F0')
being evaluated as true ?

Thanks
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Thu Jul 22, 2004 9:22 am    Post subject: Reply with quote

Hi dhruv,

If you change your compiler opts to ...,LIST,NOOFF,... and look at the generated Assembler code for your various instructions, you'll have your answers.

If your REAL ques is "Why did IBM decide to make these instructions behave this way?", only they can answer that. They may even be persuaded to change it, but don't count on it. Mr. Green

Regards, Jack.
Back to top
View user's profile Send private message
dhruv
Beginner


Joined: 01 Jun 2004
Posts: 10
Topics: 1

PostPosted: Thu Jul 22, 2004 10:59 am    Post subject: Reply with quote

Thanks for all your replies.

The reason i had posted this question was I was under the impression that I was missing something basic.

But if thats the way the cobol compiler is implemented, then ofcourse, i am leaving it at this.

Thanks
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