Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

What's the size of -9(4).999

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
markanthos

New User


Joined: 28 Apr 2005
Posts: 14
Location: India

PostPosted: Wed May 11, 2005 12:24 pm    Post subject: What's the size of -9(4).999
Reply with quote

At an HSBC interview I came across the query:

A pic clause is declared as -9(4).999

How many memory locations will this occupy

a)7
b)8
c)9
d)none of the above
and why?
Back to top
View user's profile Send private message

gnagakishore

New User


Joined: 26 Mar 2005
Posts: 25
Location: Hyderabad

PostPosted: Wed May 11, 2005 12:29 pm    Post subject: Re: interview queries
Reply with quote

it will occupy 8(eight) bytes.
the reason for that is we have to count "." (dot) aslo.
and comming to "-" it wont occupy any memory unless if we stated "sign traling or leading separate character".[/b]
Back to top
View user's profile Send private message
markanthos

New User


Joined: 28 Apr 2005
Posts: 14
Location: India

PostPosted: Wed May 11, 2005 12:50 pm    Post subject:
Reply with quote

Thanks a lot
Back to top
View user's profile Send private message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Wed May 11, 2005 2:03 pm    Post subject: Re: What's the size of -9(4).999
Reply with quote

since it is numeric edited character it will occupy 9 bytes..it will take one byte for '-' sign also.

please advice.

Thanks
Deepa
Back to top
View user's profile Send private message
avalanches

New User


Joined: 10 May 2005
Posts: 28

PostPosted: Wed May 11, 2005 2:33 pm    Post subject:
Reply with quote

Deepa,

The sign will occupy the lower nibble of the right most digit.

Cheers,
avalanches
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Wed May 11, 2005 2:44 pm    Post subject:
Reply with quote

Hi Markanthos,
I agree with deepa that the variable is going to take 9 bytes as storage.

An easy way to find out the lenght of any variable is to have a member (say test) in your copylib pds. Then define that variable whose length you want to find out in this member test. Now save this member and open it in fileaid (option F:8 or H:8 as per your installation). If the definition is syntactically correct you will get the lenght.

Let me know if you have any concerns.
David.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Wed May 11, 2005 3:05 pm    Post subject:
Reply with quote

even i aslo agree with deepa...i think it will take 9 bytes as it is just a simple declaration...not defined as s9(4).999, in this case it will take i think 8, but when you specify -9(4).999 then it will take 9.
Back to top
View user's profile Send private message
praveenhj

New User


Joined: 05 Apr 2005
Posts: 6
Location: bangalore

PostPosted: Wed May 11, 2005 5:19 pm    Post subject:
Reply with quote

hi, i agree with this it will take 9 bytes, not 8 bytes b'coz it id not declared with s9(4).999.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri May 13, 2005 9:03 pm    Post subject:
Reply with quote

In this case the sign is called a floating edit char and occupies one byte of storage.
Back to top
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Fri May 13, 2005 9:26 pm    Post subject:
Reply with quote

So if I colored the reply in RED, it contains error. GREEN means, it is accepted by the moderator. Any Suggestions?
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 To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Increase the screen size after split mistah kurtz TSO/ISPF 2 Fri Sep 02, 2016 6:39 pm
No new posts ALTER of an IDMS AREA with NEW/OLD pa... Awanti IDMS/ADSO 2 Mon Mar 14, 2016 10:01 pm
No new posts Add Trailing Zeroes depending upon th... Rohit Umarjikar DFSORT/ICETOOL 3 Fri Oct 23, 2015 1:47 am
No new posts Data Type and Size senthamizh DB2 2 Fri Aug 21, 2015 2:34 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us