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 

Data type conversion

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


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Thu Jan 04, 2007 7:13 am    Post subject: Data type conversion Reply with quote

Hi Gurus,

"IF TMA-OFF-NBR EQUAL OND-RETURN-PAYLOC"

The above COBOL comparison result in the following assembler code.
Code:

025598  IF                                                                     
   027432  4880 2028               LH    8,40(0,2)               TMA-OFF-NBR   
   027436  4E80 DF88               CVD   8,3976(0,13)            TS2=16         
   02743A  F212 DF90 5460          PACK  3984(2,13),1120(3,5)    TS2=24         
   027440  D100 DF91 C04F          MVN   3985(1,13),79(12)       TS2=25         
   027446  F921 DF8D DF90          CP    3981(3,13),3984(2,13)   TS2=21         

The definition of the two fields involved in the comparison are given below.
Code:

07 TMA-OFF-NBR         PIC S9(03)  COMP.
07 OND-RETURN-PAYLOC   PIC  9(03).

Before the comparison, both the fields are converted to packed decimal and then compared.

I guess the similar to the above IF statement, data type conversion happens in COMPUTE, ADD, SUBTRACT, MUTIPLY, DIVIDE

operations.

I would like to know how the data type conversions are performed in IF and Arithmatic operations.

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


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

PostPosted: Thu Jan 04, 2007 9:29 am    Post subject: Reply with quote

Ravikumar,

The code generated for comparision as well as Arthimetic operations depends on the compiler option NUMPROC. This compiler option controls how whenever your numeric internal decimal and zoned decimal data might use nonpreferred signs. The compiler accepts any valid sign configuration: X'A', X'B', X'C', X'D', X'E', or X'F'. The default compiler option is NUMPROC(NOPFD).

Check this link which explains in detail about the NUMPROC compiler option

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/2.4.34?DT=20020923143836

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


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Fri Jan 05, 2007 6:07 am    Post subject: Reply with quote

Kolusu,

Thank you very much for your prompt reply.

I am not talking about the sign. I would like to know how the data type conversions are performed in IF and Arithmatic operations before that operation begins.

Thanks,
Ravikumar.
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