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

Can we declare decimal value by a comp variable


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

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Sun Jul 30, 2006 9:23 am
Reply with quote

Hi all,


Can we declare Decimal value to a comp variable.
Eg: Can we declare 9(2)V9(2) comp.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Sun Jul 30, 2006 12:07 pm
Reply with quote

Quote:
Can we declare Decimal value to a comp variable.

Yes...
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Sun Jul 30, 2006 7:11 pm
Reply with quote

Hi Priyush, I am thinking that we can't use COMP clause for decimals, for decimals we can use COMP-3. Decimals are allowing in COMP from the recent versions of Cobol or from the beginning? Can you please let me know about it.

Thanks!
Rat...
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Jul 31, 2006 1:09 am
Reply with quote

Deleted by author. I completely misread the ques.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Jul 31, 2006 10:58 am
Reply with quote

Hi Priyush, I am thinking that we can't use COMP clause for decimals, for decimals we can use COMP-3. Decimals are allowing in COMP from the recent versions of Cobol or from the beginning? Can you please let me know about it.

Thanks!
Rat...

What do u say Priush?

CAn we declare 9(2)V9(2)?
Back to top
View user's profile Send private message
neelesht

New User


Joined: 24 Jul 2006
Posts: 99
Location: Los Angeles

PostPosted: Mon Aug 14, 2006 1:36 pm
Reply with quote

Hi all,

Any updates on the above qns posted by Ekta....

Enjoy....
Neelesh
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Sat Aug 19, 2006 7:05 pm
Reply with quote

We can use comp for desimal points in z/os with cobolV3.2 and i dont know clearly about other versions
Back to top
View user's profile Send private message
Aditya Bhardwaj
Warnings : 1

New User


Joined: 02 Nov 2004
Posts: 18
Location: Noida, India

PostPosted: Sun Aug 20, 2006 1:24 am
Reply with quote

Hi,

When usage is specified as COMP, the numeric data item is represented in pure binary. The item must eb an integer (no assumed decimal point is allowed). Such data items are often used as subscripts.
Back to top
View user's profile Send private message
prashanth1

New User


Joined: 27 Sep 2006
Posts: 47
Location: Hyderabad

PostPosted: Wed Oct 04, 2006 2:24 pm
Reply with quote

COMP-1 and COMP-2 supports for floating values.
Back to top
View user's profile Send private message
sweetselva

New User


Joined: 17 Dec 2006
Posts: 4
Location: USA

PostPosted: Mon Dec 18, 2006 3:23 am
Reply with quote

Yes. COMP -1 and COMP-2 supports decimal values.
COMP-1 uses one word and COMP-2 uses 2 word of memory.

Regards,
Selva
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Dec 18, 2006 11:45 am
Reply with quote

Hi

We can use COMP for storing decimal values.It is possible.

Thanks
Arun
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top