Which will take more memory?



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Which will take more memory?

Postby nikhilgalgate » Wed Dec 26, 2007 8:13 pm

Hi

Please any one can tell me if I have to store a number and alphanumeric or alphabatic value which one will take less memory space. If we see in terms of example. if I have to store number 1 and alphabate A which will take less memory?. :?
nikhilgalgate
 
Posts: 9
Joined: Tue Dec 25, 2007 1:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Which will take more memory?

 

Re: Which will take more memory?

Postby arunprasad.k » Fri Jan 04, 2008 12:30 am

nikhilgalgate,

As far as I know,

1. If you are storing it in a variable, then the storage depends on the the PICTURE cluase of the variable.
2. If you are storing it in a file, then it depends on the SPACE parameter specified in the JCL.

Arun.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Which will take more memory?

Postby sureshbabu » Mon Jan 07, 2008 2:48 pm

01 ws-data picx(n) value data

here ws-data is called literal
here if data is numeric you can store max of 18 digits
if data is alphabitic you can store 160 characters
i hope you done the problem
sureshbabu
 
Posts: 7
Joined: Tue Dec 18, 2007 12:39 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Which will take more memory?

Postby dick scherrer » Wed Jan 16, 2008 2:40 am

Hello,
if I have to store number 1 and alphabate A which will take less memory?.

Either could take as little as one byte. If you are looking for some other info, please clarify.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post