IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Comp 4 - Binary Variable


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue May 15, 2012 3:48 pm
Reply with quote

Hi

This is regarding COMP-4 (Binary) variables.

I have comp-4 variable declared as below

77 subh pic 9(4) comp-4.

Kindly let me know what will be maximium value this field (subh) can accomodate.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue May 15, 2012 3:51 pm
Reply with quote

Have you looked in the manual (link at the top of the page), and what didn't you understand?

The answer also depends on Compile option TRUNC, so look at that as well.
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Tue May 15, 2012 4:05 pm
Reply with quote

icon_smile.gif

ibmmainframes.com/viewtopic.php?t=58071&highlight=comp4
Back to top
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue May 15, 2012 4:11 pm
Reply with quote

As my variable is

77 subh PIC 9(4) comp-4.

I believe here subh will occupy 2 bytes only. If so maximum number of digits field subh can accomodate is 1 to 4.

Kindly let me know if this is correct
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue May 15, 2012 4:18 pm
Reply with quote

Well, if you now want to know the maximum digits, then no, you are wrong.

As Naish has pointed you to your other post on the subject and you've not cracked it from that, I don't know what we can do that will be much use to you in an interview.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top