Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
regarding comp declarations

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    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

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: 32
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: 32
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: 363
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
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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need help to populate date in COMP-3 ... chetanambi DFSORT/ICETOOL 3 Tue Jun 21, 2016 12:25 pm
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts SIGNED DECIMAL TO COMP-3 using cobol ... ram_vizag COBOL Programming 1 Tue Mar 01, 2016 11:32 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us