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

What means PIC -(8)9 ?


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

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Fri Mar 18, 2011 3:33 pm
Reply with quote

Can anyone please explain how this declaration works in cobol
Code:

05  OUT-CNT-MF                             PIC -(8)9.

This code is working fine. But i want to know how the size and length of data is assigned?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Mar 18, 2011 4:01 pm
Reply with quote

What experiments have you undertaken to find out for yourself? Have you looked at the manual? have you asked colleagues? Have you written a little program with a variable defined like that and looked at the compiler output to see how much space the compiler assigned it?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Mar 18, 2011 4:04 pm
Reply with quote

Gopalakrishnan V wrote:
Can anyone please explain how this declaration works in cobol
Code:

05  OUT-CNT-MF                             PIC -(8)9.

This code is working fine. But i want to know how the size and length of data is assigned?


Thanks in advance

As your comprehension of written English is too limited to allow you to understand the manual, I will try to make my explanation of the phenomenon simple enough for you to follow.

Since no USAGE clause is specified, the variable is USAGE IS DISPLAY. There are eight ("(8)") floating minus signs ("-"), and one digit ("9"), making a total of nine (8+1) bytes used. Capisce?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Mar 18, 2011 4:12 pm
Reply with quote

Quote:
But i want to know how the size and length of data is assigned?
Did you start by looking at the data map output of the compiler to see how the compiler interpreted the PICTURE? If not, why not? Seeing what the compiler generated is usually a good way to understand any PIC clauses you don't understand.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Mar 18, 2011 5:44 pm
Reply with quote

Robert Sample wrote:
Did you start by looking at the data map output of the compiler ...

compiler ? data map?
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 Licensed Materials & Restricted M... General Talk & Fun Stuff 10
No new posts Null Indicator value -2 means in Embe... DB2 2
No new posts What's the +1 means in CLC FOUR,SIX+1 ? PL/I & Assembler 2
No new posts Securely storing ftp password in acf2... CA Products 1
No new posts What Does "OC" Instruction ... PL/I & Assembler 7
Search our Forums:

Back to Top