Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data types accepting all catregeries

Ranjith_D_Reddy
Participant
0 Likes
1,998

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.

6 REPLIES 6
Read only

matt
Active Contributor
0 Likes
1,485

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.

Read only

Former Member
0 Likes
1,485

Char type will accept all values like decimal, integer, Character.Is this answers your question?

Read only

0 Likes
1,485

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.

Read only

Former Member
0 Likes
1,485

type string.

Regards

Read only

0 Likes
1,485

ya Alvear it's wrking

thanks for the reply

Read only

Former Member
0 Likes
1,485

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.