View previous topic :: View next topic
|
Author |
Message |
Harshavardhana
New User
Joined: 09 Mar 2007 Posts: 7 Location: India
|
|
|
|
Hi Friends,
I have the following variables:
01 VAR-1 PIC X(15) VALUE 'AAAAA '.
01 VAR-2 PIC X(05) VALUE '11111'.
01 VAR-3 PIC X(10) VALUE SPACES.
Now, I need to concatenate VAR-1 and VAR-2 to get the VAR-3 with the value 'AAAAA11111'.
Is there a way to achieve this in COBOL? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Harshavardhana wrote: |
Is there a way to achieve this in COBOL? |
Yes, with the STRING statement. |
|
Back to top |
|
|
Harshavardhana
New User
Joined: 09 Mar 2007 Posts: 7 Location: India
|
|
|
|
Hi William,
Thank you for providing me with the link for STRING statement.
I could not get the required answer in the link.
Could you please tell me how to achieve this using the STRING statement?
Thanks. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Did you look at the example and explanation for Figure 17 (the example is just above the figure)? |
|
Back to top |
|
|
Harshavardhana
New User
Joined: 09 Mar 2007 Posts: 7 Location: India
|
|
|
|
Yes...!, I could see the example. I also used the same in my pgm and I got what I required.
Thank You very much William. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Harshavardhana wrote: |
Yes...!, I could see the example. I also used the same in my pgm and I got what I required. |
Bless you heart for trying, and have a happy day.... |
|
Back to top |
|
|
|