Data oftype 345,456,333.78



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

Data oftype 345,456,333.78

Postby gauravkb33 » Fri Jun 08, 2012 1:04 pm

Is it possible to perform arithmetic operations on data of type 345,456,333.78 ? If yes what is the process of declaring such data types ?
gauravkb33
 
Posts: 9
Joined: Mon Jun 04, 2012 1:28 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Data oftype 345,456,333.78

Postby BillyBoyo » Fri Jun 08, 2012 1:17 pm

Not possible directly. Look at INTRINSIC FUNCTION NUMVAL in the manual. It can convert that to a format you can use for calculation. Be aware, if you give NUMVAL bad data, it will abend.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Data oftype 345,456,333.78

Postby gauravkb33 » Fri Jun 08, 2012 5:48 pm

BillyBoyo wrote:Not possible directly. Look at INTRINSIC FUNCTION NUMVAL in the manual. It can convert that to a format you can use for calculation. Be aware, if you give NUMVAL bad data, it will abend.


Thanks for the reply. Helped a lot. :)
gauravkb33
 
Posts: 9
Joined: Mon Jun 04, 2012 1:28 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Data oftype 345,456,333.78

Postby BillyBoyo » Fri Jun 08, 2012 6:02 pm

Glad to hear it.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Data oftype 345,456,333.78

Postby Robert Sample » Fri Jun 08, 2012 6:03 pm

Terminology is critical in IT, where similar terms may mean very different things. And "345,456,333.78" is NOT a data type -- it is a data value. The COBOL variable that contains this value is a numeric edited variable -- so "numeric edited" is a data type. COBOL variables can be alphabetic, alphanumeric, numeric, numeric edited, pointers, conditionals, groups, and so forth -- you would do well to learn the terminology now and use the correct terms to prevent confusion in the future.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Data oftype 345,456,333.78

Postby gauravkb33 » Fri Jun 08, 2012 8:19 pm

Robert Sample wrote:Terminology is critical in IT, where similar terms may mean very different things. And "345,456,333.78" is NOT a data type -- it is a data value. The COBOL variable that contains this value is a numeric edited variable -- so "numeric edited" is a data type. COBOL variables can be alphabetic, alphanumeric, numeric, numeric edited, pointers, conditionals, groups, and so forth -- you would do well to learn the terminology now and use the correct terms to prevent confusion in the future.

I think there is difference between Data of Type 345,455... and Data type. So what I write seems to be correct only. Correct me if I am wrong.
gauravkb33
 
Posts: 9
Joined: Mon Jun 04, 2012 1:28 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Data oftype 345,456,333.78

Postby NicC » Fri Jun 08, 2012 8:25 pm

Data in the format of... would have been better. Type is not really the correct English word here when you are describing the actual data i.e. 345,543,123,99. As Robert pointed out 'data type' in IT means the generic format of the data e.g alpha, alpha numeric, edited numeric (or numeric edited) etc. It really is a bit of a semantic issue but 'data type' is a recognised IT term so best to try and avoid similar phrases such as 'data of type' which should really be followed by a datatype eg. data of type alphabetic.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Data oftype 345,456,333.78

Postby dick scherrer » Fri Jun 08, 2012 9:19 pm

Hello,

I think there is difference between Data of Type 345,455... and Data type. So what I write seems to be correct only. Correct me if I am wrong.
Yes, you are wrong. . .

It is important to use the "standard" termnology and not make up terminology that you think will work. You will find yourself quite frustrated when people misunderstand you.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Data oftype 345,456,333.78

Postby Robert Sample » Fri Jun 08, 2012 9:24 pm

A standard definition:
In certain technical fields (especially computer programming and statistics), a data type is a classification identifying one of various types of data, such as real-valued, integer or Boolean, that determines the possible values for that type; the operations that can be done on values of that type; the meaning of the data; and the way values of that type can be stored.
Using this definition, what you provided in your original post is NOT a "data type" at all. As Dick said, you are wrong. If you wish to continue in your wrongness, do not do so here -- we prefer standard terminology as much as possible, since debugging issues becomes much easier when everyone refers to the same things in the same way.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post