Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Significance of value -252645136 while initializing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Tue Aug 17, 2010 10:52 am    Post subject: Significance of value -252645136 while initializing
Reply with quote

Hi,

Can anyone let me know the significance of the value -252645136 which was holded by the sublevel variables(var1,var2 & var3) in the given structure when I to try initialize using the below statement

Move zeroes to groupvar1.

01 groupvar1.
05 var1 pic s9(9) comp.
05 var2 pic s9(9) comp.
05 var3 pic s9(9) comp.

If I use the statement INITIALIZE groupvar1. The variables(var1,var2 & var3) are having value as zero.
Back to top
View user's profile Send private message

Kurt Deininger

New User


Joined: 13 Jul 2010
Posts: 19
Location: Frankfurt/Germany

PostPosted: Tue Aug 17, 2010 11:07 am    Post subject:
Reply with quote

Hi murugan_mf,

The value -252645136, converted to hex, is F0F0F0F0, which in turn converted to EBCDIC is "0000". Field groupvar1 is a group item, which is treated like an X(12) alphanumeric field, therefore, the figurative constant ZERO is a string of EBCDIC zeroes.

Cheers. Kurt
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Tue Aug 17, 2010 11:43 am    Post subject: Reply to: Significance of value -252645136 while initializin
Reply with quote

Kurt,

Thanks a lot!
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Tue Aug 17, 2010 12:23 pm    Post subject:
Reply with quote

Hi Kurt,

I have checked the hex value for -252645136 its having the value as below

-252645136
6FFFFFFFFF
0252645136

Can you please clarify, its contradicting what you have said earlier.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 17, 2010 1:20 pm    Post subject:
Reply with quote

murugan_mf,

what you have is the ebcdic representation of -252645136.
that is not the hex equivalent of -252645136.

Kurt made no contradicting statement.
although, he made the mistake of assuming you understood basic computer concepts.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Aug 17, 2010 3:52 pm    Post subject: Reply to: Significance of value -252645136 while initializin
Reply with quote

Moving ZEROS to GROUPVAR1 (a group move), will cause the compiler to move X'F0F0F0F0F0F0F0F0F0F0F0F0'.

Moving LOW-VALUES to GROUPVAR1, will cause the compiler to move X'000000000000000000000000'.

The LOW-VALUES move is the same as moving ZEROS to each of the elementary COMP items which belong to the GROUP. In your example, each COMP elementary item is 4-Bytes long, sometimes referred to a a binary-fullword.

GROUP moves are always considered by the compiler to be ALPHANUMERIC.

So, ZEROS at a GROUP level and ZEROS at an ELEMENTARY level are different.

If the GROUP had (for example) 12 elementary items, defined as PIC 9(15) (Display-Numeric), then moving ZEROS to the GROUP would be correct.

Suggest a review of the MOVE statement in the applicable COBOL manual is in order.

Bill
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8003
Location: Bellevue, IA

PostPosted: Tue Aug 17, 2010 3:54 pm    Post subject:
Reply with quote

There is a link to manuals at the top of the page. Click on it, find the COBOL Language Reference manual for your version of COBOL, and read until you find out about the internal representation of numbers in COBOL. Convert your -252645136 value to hex and compare to the internal representation of your variables. Hopefully, you will begin to understand.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Initializing filler default value whe... dsivapradeep COBOL Programming 6 Thu Feb 13, 2014 11:17 am
No new posts VSAM Initializing causing Repro to ru... bpavan2k4 JCL & VSAM 4 Fri Nov 29, 2013 6:27 pm
No new posts what is the significance of REPLACE=N... Bill Woodger JCL & VSAM 6 Thu Feb 07, 2013 1:10 pm
No new posts Significance of APOST and XREF in PARM Kalyan Chakravarthi JCL & VSAM 2 Fri Jan 18, 2013 5:06 pm
No new posts Content of variable before moving or ... hemu88 COBOL Programming 10 Fri Feb 10, 2012 9:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us