Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
regarding comp declarations

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
medepallirao

New User


Joined: 05 May 2005
Posts: 6
Location: pune

PostPosted: Thu May 19, 2005 10:50 am    Post subject: regarding comp declarations
Reply with quote

please answer the questions


1. how many bytes does s9(4) comp-3 field take?
2. how many bytes does 9(4) comp-3 field take?
3. give me clear idea on PARM parameter

if i want to take 10 bytes of data by using parm parameter how can u declare it cobol and what u code in jcl
Back to top
View user's profile Send private message
References
swaran_msc

New User


Joined: 19 May 2005
Posts: 5
Location: Bangalore

PostPosted: Thu May 19, 2005 12:32 pm    Post subject:
Reply with quote

s9(4) Comp-3 will take (n+1)/2 = 2.5 = 3 bytes.

9(4) Comp-3 will take n/2 = 2 bytes.

For Parm Parameter Refer Chapter 1 in Mvs Jcl Primer by Saba Zamir.


Corrections are Welcome...
Back to top
View user's profile Send private message
ajay_dheepak

New User


Joined: 12 May 2005
Posts: 33
Location: Chennai

PostPosted: Thu May 19, 2005 12:48 pm    Post subject:
Reply with quote

For both it is 3 bytes
Back to top
View user's profile Send private message
ajay_dheepak

New User


Joined: 12 May 2005
Posts: 33
Location: Chennai

PostPosted: Thu May 19, 2005 12:50 pm    Post subject:
Reply with quote

Declaration Value Internal representation
PIC S9(4) COMP-3 + 1234 01 23 4C

PIC 9(4) COMP-3 1234 01 23 4F

so for both it is 3 bytes
Back to top
View user's profile Send private message
subhasis_50

Moderator


Joined: 09 Mar 2005
Posts: 367
Location: Earth

PostPosted: Thu May 19, 2005 4:49 pm    Post subject: Re: regarding comp declarations
Reply with quote

Hi,
Ajay is correct. It will take 3 bytes. In case of COMP-3 variable the sign is stored rightmost half a byte of character as it is the representation of packed decimal. It is not a fact that S is mentioned or not.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1