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

clarification needed on ASSIGN statement

Former Member
0 Likes
768

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
Read only

Former Member
0 Likes
734

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
Read only

Former Member
0 Likes
734

Hi sarika,

1. Use brackets ().

2.

assign (x) to <datain>.

regards,

amit m.

Read only

Former Member
0 Likes
735

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

Read only

Former Member
0 Likes
734

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.

Read only

0 Likes
734

Hi sharath,

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

thanks.

SARIKA.

Read only

0 Likes
734

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.

Read only

0 Likes
734

Hey sharath,

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

Sarika