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

What is the maximum limit for length for a COBOL copybook


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

New User


Joined: 14 Nov 2006
Posts: 16

PostPosted: Thu Nov 16, 2006 11:26 am
Reply with quote

1. What is the maximum limit for length for a COBOL copybook?
2. What is internal storage for COMP and COMP-3 for a value "12547"?
3. What is maximum value (in bytes and value) that can be passed from jcl to COBOL thru parm
4. What is maximum value (in bytes and value) that can be passed from jcl to COBOL thru sysin?..
5. How many values can be acceptable in one ACCEPT in COBOL..
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Sun Nov 19, 2006 9:57 pm
Reply with quote

Quote:
2. What is internal storage for COMP and COMP-3 for a value "12547"?

COMP is compiler dependent... where as COMP-3 would store it in Hex format.
Quote:
3. What is maximum value (in bytes and value) that can be passed from jcl to COBOL thru parm

100
Quote:
4. What is maximum value (in bytes and value) that can be passed from jcl to COBOL thru sysin?..

256... I guess, might want to check...
Quote:
5. How many values can be acceptable in one ACCEPT in COBOL..

One.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Nov 20, 2006 2:42 am
Reply with quote

Hi,

Quote:
2. What is internal storage for COMP and COMP-3 for a value "12547"?


COMP 2 bytes
COMP-3 3 bytes

HI Priyesh,

As far as I know, the memory allocated isn't compiler dependent but the # of accessable digits may be restricted to the PIC digits depending on the comiler option selected at compile time.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Mon Nov 20, 2006 6:30 am
Reply with quote

Thanks Jack.
Back to top
View user's profile Send private message
jain.eti

New User


Joined: 23 Jan 2007
Posts: 25
Location: delhi

PostPosted: Sat Feb 03, 2007 9:48 pm
Reply with quote

What is internal storage for COMP and COMP-3 for a value "12547"?


COMP - 4 bytes ( as comp takes 4 bytes for (s9(05) - s9(09))
COMP-3 3 bytes


correct me if i am wrong.....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Feb 04, 2007 6:52 am
Reply with quote

Hello,

Quote:
Quote:
4. What is maximum value (in bytes and value) that can be passed from jcl to COBOL thru sysin?..

256... I guess, might want to check...


If you read from a SYSIN DD statement there basically is NO limit to the volume of data. "Bytes and value" are not relevant when reading data from a DD.

If i misunderstood the question, please let me know.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Feb 11, 2007 9:23 am
Reply with quote

Hi Jain,

Finally got the energy to ans this:
Quote:
COMP - 4 bytes ( as comp takes 4 bytes for (s9(05) - s9(09))

In a way we're both right. It depends on the TRUNC option selected at compile time.

If TRUNC(BIN) then I'm right. If any other, you are.

Example: even if my field, using TRUNC(BIN), was defined as PIC 9 COMP it will accept a value up to 32767.
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 Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
Search our Forums:

Back to Top