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

regarding comp declarations


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
medepallirao

New User


Joined: 05 May 2005
Posts: 6
Location: pune

PostPosted: Thu May 19, 2005 10:50 am
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
swaran_msc

New User


Joined: 19 May 2005
Posts: 5
Location: Bangalore

PostPosted: Thu May 19, 2005 12:32 pm
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: 32
Location: Chennai

PostPosted: Thu May 19, 2005 12:48 pm
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: 32
Location: Chennai

PostPosted: Thu May 19, 2005 12:50 pm
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: 363
Location: Earth

PostPosted: Thu May 19, 2005 4:49 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
Search our Forums:

Back to Top