2013 Jun 24 11:22 AM
Hi,
I need the data type which will accepts the values like integer format ,decimal format & charactristic format
example like as follows.
12
12.36
abcd
regards,
ranjith.
2013 Jun 24 11:53 AM
There isn't one. There are generic types like DATA, but these probably won't help. You have to use a char character type and convert it.
2013 Jun 24 1:41 PM
Char type will accept all values like decimal, integer, Character.Is this answers your question?
2013 Jun 24 3:08 PM
HI Rajasekaran,
Char Type will not accept the decimal values passed.It will accept the part before the decimal point only.the part after the decimal point is neglected.
2013 Jun 24 1:46 PM
2013 Jun 24 3:06 PM
2013 Jun 24 2:25 PM
I am not sure if this meets your requirement, But if you want a common work variable which can be used to pass data to other variables of different data types, then you can use field symbols.
data : int type i,
char(10) type c,
pack type p DECIMALS 2.
FIELD-SYMBOLS: <fs1>.
ASSIGN int to <fs1>.
<fs1> = 12.
UNASSIGN <fs1>.
ASSIGN char to <fs1>.
<fs1> = 'abcd'.
UNASSIGN <fs1>.
ASSIGN pack to <fs1>.
<fs1> = '12.36'.
UNASSIGN <fs1>.
Write 😕 int , char, pack.
Here the field symbol took the datatype of the variable it was assigned to.
The integer value was passed to the integer field, character value and packed decimal were all moved to the respective variable through the common variable <Fs1> which can hold data of any data type.