Application Development 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: 

clarification needed on ASSIGN statement

Former Member
0 Kudos

Hi ,

when i write " ASSIGN P0000-MASSN to <DATAIN>" the value of p0000-massn is being assigned to <datain>.

But when i did like below iam not getting.

concatenate 'P' '0000' '-' 'MASSN' into x.

assign x to <datain>.

now the value is not getting assigned . why?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use the following statement :

assign (x) to <datain>.

This will assign the value which is contained in x.

If you use assign x to <datain>, then x would be assigned to <datain>.

Hope this clarifies your doubt.

Regards,

Lalit

6 REPLIES 6

Former Member
0 Kudos

Hi sarika,

1. Use brackets ().

2.

assign (x) to <datain>.

regards,

amit m.

Former Member
0 Kudos

Hi,

Use the following statement :

assign (x) to <datain>.

This will assign the value which is contained in x.

If you use assign x to <datain>, then x would be assigned to <datain>.

Hope this clarifies your doubt.

Regards,

Lalit

Former Member
0 Kudos

Hi Sarika

Instead of the statement

assign x to <datain>.

Use this statement

assign (x) to <datain>.

This is done because when u concatenate 'X' will store only the string 'P0000-MASSN'. It does not actually point to the value of massn. By using the braces we are actually making the system look for the value stored in P0000-MASSN.

Thanks

Sharath.

0 Kudos

Hi sharath,

Thanks for ur immediate reply but it is not working. Can you suggest another way.

thanks.

SARIKA.

0 Kudos

Hi Sarika,

Check this sample program

REPORT test.

data:

x type char20,

p0000 type p0000.

field-symbols:

<fs> TYPE any.

p0000-massn = '01'.

write: p0000-massn.

concatenate 'P' '0000' '-' 'MASSN' into x.

ASSIGN (X) TO <fs>.

<fs> = '02'.

write: p0000-massn.

0 Kudos

Hey sharath,

Its working! great ! Thank you very much...

Sarika